Saral Shiksha Yojna
Courses/Computer Vision

Computer Vision

CSE471
Prof. Makarand Tapaswi + Prof. Charu SharmaSpring 2025-264 credits
Sample Papers/Mock Paper 13 — Code Reading + Algorithm Completion + Pseudocode

Mock Paper 13 — Code Reading + Algorithm Completion + Pseudocode

Duration: 150 min • Max marks: 100

Section A — What does this code do? (3 marks each, 30 marks)

30 marks
  1. 1.Code reads a k×k window per pixel via reflect padding, computes np.median. What is it and when used?3 m
  2. 2.Code convolves the image with [[-1,0,1],[-2,0,2],[-1,0,1]] for G_x and its transpose for G_y, then returns √(G_x² + G_y²). What does it compute?3 m
  3. 3.Code sorts indices by score desc, pops the top, computes IoUs vs the rest, drops IoU ≥ thresh. Trace with boxes [0.9, 0.85, 0.7], IoUs (0,1)=0.6, (0,2)=0.3, (1,2)=0.4, thresh=0.5.3 m
  4. 4.Code computes mean and var over the last dimension keepdim, normalises, then γ·x̂ + β. Identify and contrast with BatchNorm.3 m
  5. 5.Code computes softmax(QKᵀ / √d_k) · V with an optional mask filling positions with −1e9. Identify and explain the mask role.3 m
  6. 6.Block: x ← x + attn(LN(x)); x ← x + MLP(LN(x)). Pre-norm or post-norm? Why preferred for modern Transformers?3 m
  7. 7.DropPath: with keep_prob = 1 − drop_path_rate, sample a Bernoulli mask per batch sample, divide x by keep_prob, multiply by the mask. What technique and why divide by keep_prob?3 m
  8. 8.IoU code uses max(box1[0], box2[0]) etc. Compute IoU for box1=[10,10,50,50], box2=[30,30,70,70].3 m
  9. 9.Code: tp.data.mul_(m).add_(sp.data, alpha=1−m) for paired teacher/student params. Identify.3 m
  10. 10.Code sorts Gaussians by depth front-to-back; for each, output += T·α[i]·c[i]; T *= (1 − α[i]); breaks when T < 1e-4. Identify and use case.3 m

Section B — Complete the Code (5 marks each, 40 marks)

40 marks
  1. 1.Complete conv2d(image, kernel, stride, padding): apply padding, compute output dims, fill the loop.5 m
  2. 2.Complete bilinear_interp(image, x, y).5 m
  3. 3.Complete MultiHeadAttention forward.5 m
  4. 4.Complete InfoNCE / SimCLR loss given features of shape (2N, D) where features[i] and features[i+N] are augmented views.5 m
  5. 5.Complete soft_nms(boxes, scores, sigma, score_thresh) with Gaussian decay.5 m
  6. 6.Complete make_heatmap(keypoint_xy, (H, W), sigma) — Gaussian heatmap target for pose.5 m
  7. 7.Complete DepthwiseSeparableConv with depthwise then pointwise.5 m
  8. 8.Complete focal_loss(pred, target, alpha=0.25, gamma=2.0).5 m

Section C — Write the Algorithm (10 marks each, 30 marks)

30 marks
  1. 1.Write pseudocode for full Mask R-CNN inference: backbone, RPN, RoI processing, classification, box regression, mask prediction, post-processing.10 m
  2. 2.Write pseudocode for DINO training: dual encoders, EMA update, multi-crop, centering, sharpening, loss.10 m
  3. 3.Write pseudocode for full 3DGS optimisation: init → render → loss → optimise → adaptive density control.10 m

Track your attempt locally — score and time are recorded in your browser. (Coming soon: timed-attempt mode.)