---
title: "Discussion on \"Instance Segmentation: Counting Cars from Public CCTV with YOLOv8 seg\" | Hashnode"
description: "Discussion on \"Instance Segmentation: Counting Cars from Public CCTV with YOLOv8 seg\". Fine-tuning YOLOv8s-seg for car instance segmentation, tested live against public CCTV in Yogyakarta. Concepts plus verified real results."
url: "https://hashnode.com/posts/car-instance-segmentation-yolov8-en/6ab0026e3fb03f7969acb462"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Instance Segmentation: Counting Cars from Public CCTV with YOLOv8 seg](https://shaka-ai.hashnode.dev/car-instance-segmentation-yolov8-en?utm_source=hashnode&utm_medium=feed)

Fine-tuning YOLOv8s-seg for car instance segmentation, tested live against public CCTV in Yogyakarta. Concepts plus verified real results.

Sep 20 · 7 min read · shaka-ai.hashnode.dev  
Updated Sep 24  
Read the article

-   [#computer-vision](https://hashnode.com/tag/computer-vision)
-   [#instance-segmentation](https://hashnode.com/tag/instance-segmentation)
-   [#yolov8](https://hashnode.com/tag/yolov8)
-   [#deeplearning](https://hashnode.com/tag/deeplearning)
-   [#deep-learning](https://hashnode.com/tag/deep-learning)
-   [#machine-learning](https://hashnode.com/tag/machine-learning)

## Written by

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

@arielshakaramiro

  
[View profile](https://hashnode.com/@arielshakaramiro)

Newbie for AI Learning | Builder | Developer | AI Enthusiast

## Responses 5

Markdown supported · ⌘↵ to post

[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.

[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.
