---
title: "Comment by Ahmet Özel on \"Instance Segmentation: Counting Cars from Public CCTV with YOLOv8 seg\" | Hashnode"
description: "Five cars at a red light is the right example, because it shows the failure is not about precision of the box, it is that boxes cannot express occlusion at all."
url: "https://hashnode.com/posts/car-instance-segmentation-yolov8-en/6ab0026e3fb03f7969acb462/comment/6ab04867b645156cb8cd0669"
---

[Discussion](https://hashnode.com/posts/car-instance-segmentation-yolov8-en/6ab0026e3fb03f7969acb462)

Comment [Instance Segmentation: Counting Cars from Public CCTV with YOLOv8 seg](https://hashnode.com/posts/car-instance-segmentation-yolov8-en/6ab0026e3fb03f7969acb462)

[Ahmet Özel](https://hashnode.com/@ahmetozel)

[Sep 20](https://hashnode.com/posts/car-instance-segmentation-yolov8-en/6ab0026e3fb03f7969acb462/comment/6ab04867b645156cb8cd0669)

Five cars at a red light is the right example, because it shows the failure is not about precision of the box, it is that boxes cannot express occlusion at all. Once instances overlap, IoU-based matching starts pairing the wrong detection with the wrong ground truth and your metrics drift away from what you can see in the video.

The Yogyakarta CCTV test is the part I would expand. Public camera footage is where segmentation models usually lose the most: low resolution, heavy compression artefacts around edges, rain, and a viewing angle nothing in COCO looks like. Mask quality degrades there long before detection recall does, so counting can stay roughly right while the masks quietly stop being usable for anything downstream.

[Muhammad Ariel Shakaramiro](https://hashnode.com/@arielshakaramiro)

[Sep 21](https://hashnode.com/posts/car-instance-segmentation-yolov8-en/6ab0026e3fb03f7969acb462/comment/6ab04867b645156cb8cd0669#reply-6ab07ff1788e4bc38820ccf1)

Thanks for this, Ahmet.. both points are sharp.

On the occlusion/IoU point: completely agree, and it's actually visible in my own validation numbers even before touching the CCTV footage. Mask mAP50-95 came out at 0.604 versus 0.668 for box mAP50-95 the gap is exactly the kind of signal you'd expect if mask quality (which has to get the boundary right, not just the general region) degrades faster than plain detection does.

On expanding the Yogyakarta section: fair critique, and I'll be honest about the gap what I tracked live was frame-level car counts, not a systematic check of mask edge quality against ground truth on the CCTV footage itself (I don't have labeled masks for that feed to compare against, only the counts). So I can say recall stayed reasonable, but I can't actually back up a claim about mask quality holding up out there the same way I can for the validation set. That's a real blind spot in what I measured, not something I checked and found fine. Appreciate you pointing at exactly where the write-up glosses over it.

[Ahmet Özel](https://hashnode.com/@ahmetozel)

[Sep 21](https://hashnode.com/posts/car-instance-segmentation-yolov8-en/6ab0026e3fb03f7969acb462/comment/6ab04867b645156cb8cd0669#reply-6ab0cc8ba45894bd8a474cd0)

The 0.604 versus 0.668 gap is a good quantitative version of the point, and it is the shape you would predict: boundary quality degrades faster than region detection, because the mask has to be right everywhere while the box only has to be roughly right.

Being explicit that you tracked counts rather than mask quality on the CCTV feed is worth more than a claim you could not back, and it points at a cheap next step. You do not need a fully labelled feed to say something defensible. Labelling masks on twenty sampled frames covering the hard cases — dusk, rain, the tightest cluster at the light — gives you a small but honest number, and these failure modes usually show up long before the sample size gets respectable.

[Muhammad Ariel Shakaramiro](https://hashnode.com/@arielshakaramiro)

[Sep 21](https://hashnode.com/posts/car-instance-segmentation-yolov8-en/6ab0026e3fb03f7969acb462/comment/6ab04867b645156cb8cd0669#reply-6ab0ee2b79a946eac942e590)

That's a genuinely cheap way to get a real signal instead of an assumption, thanks. Sampling the hard cases specifically (dusk, rain, the tightest cluster) rather than a random 20 frames makes sense too — that's exactly where a mask is most likely to fall apart first. I don't have a concrete timeline for it right now, but it's a solid, low-effort follow-up candidate if I revisit this project.

[Ahmet Özel](https://hashnode.com/@ahmetozel)

[Oct 4](https://hashnode.com/posts/car-instance-segmentation-yolov8-en/6ab0026e3fb03f7969acb462/comment/6ab04867b645156cb8cd0669#reply-6ac296948e7de5c668c30a87)

That follow-up can stay small, but I would label it a stress sample rather than a representative accuracy estimate. Selecting only dusk, rain, and tight clusters is useful for finding failures; it cannot tell us how often those failures occur across the full feed.

I should also qualify my earlier interpretation: the 0.604 versus 0.668 aggregate gap alone does not establish that occlusion caused it. Record occlusion and image conditions with each annotated frame, then compare the subsets. That turns the plausible explanation into something you can actually test.
