1
0
Fork
You've already forked TF-CCTV
0
forked from Curid/TF-CCTV
TF-CCTV is a Coral compatible Tensorflow model designed to process CCTV footage.
  • PureBasic 96.3%
  • Python 3.2%
  • TypeScript 0.3%
Find a file
2025年01月31日 20:50:55 +00:00
bench add yolo 2025年01月25日 17:17:46 +00:00
datasets small fixes 2024年12月18日 20:33:23 +00:00
docker add eval runner script 2025年01月27日 20:43:43 +00:00
docs add accuracy plots 2025年01月31日 17:24:13 +00:00
eval add missing evals 2025年01月29日 18:21:14 +00:00
labels evaluate spaghettinet 2024年09月21日 18:51:09 +00:00
models Fix cctv4 export_tflite.py 2025年01月27日 08:19:22 +00:00
od Fix cctv4 export_tflite.py 2025年01月27日 08:19:22 +00:00
pretrained_models evaluate most of the official tflite models 2024年11月29日 18:57:17 +00:00
py_utils add accuracy plots 2025年01月31日 17:24:13 +00:00
records add objects365 eval records to the repo 2024年12月02日 20:03:08 +00:00
utils release cctv3.3 2023年01月04日 20:05:09 +00:00
yolo export yolov9s cpu 2025年01月31日 20:50:55 +00:00
.flake8 add Fiftyone script 2021年12月06日 19:32:54 +01:00
.gitignore remove USE_EDGETPU 2025年01月26日 18:54:28 +00:00
.pylintrc add Fiftyone script 2021年12月06日 19:32:54 +01:00
LICENSE change license to agplv3 2025年01月25日 17:07:34 +00:00
README.md add accuracy plots 2025年01月31日 17:24:13 +00:00

TF-CCTV

Custom Coral compatible Tensorflow models designed to process CCTV footage.

Matrix chat


Accuracy

objects365-val-cctv-v1_person

EDGETPU

objects365-val-cctv-v1_person_edgetpu_color objects365-val-cctv-v1_person_edgetpu_gray

raw data
MODEL mAP L M S RPI5
mobilenetV1 color 33.5 50.5 12.4 0.4 3.3 a
mobilenetV1 gray 29.6 45.8 9.1 0.2 3.3
-
mobilenetV2 color 38.2 57.9 13.8 0.9 3.7 b
mobilenetV2 gray 32.7 51.4 9.4 0.7 3.7
-
mobiledet_official color 46.4 64.0 24.7 4.5 6.1 c
mobiledet_official gray 41.4 59.3 18.3 3.0 6.1
-
mobiledet color 45.3 62.7 23.6 4.4 4.0 d
mobiledet gray 40.5 58.2 17.4 2.9 4.0 a
-
spaghettinet_m color 45.5 62.5 25.0 3.3 4.1 e
spaghettinet_m gray 40.6 57.5 19.7 2.8 4.1
spaghettinet_l color 46.9 63.8 26.5 5.2 4.1 f
spaghettinet_l gray 41.7 58.0 21.7 2.8 4.1 b
spaghettinet_l_official color 45.9 63.4 24.4 3.8 3.7 g
spaghettinet_l_official gray 41.1 58.2 19.9 2.0 3.7
-
yolov5nu_320x320 color 44.6 62.4 22.8 0.7 8.0 h
yolov5nu_320x320 gray 33.9 50.1 15.2 1.3 8.0 c
yolov5nu_480x480 color 51.9 68.3 31.3 7.3 19.0 i
yolov5nu_480x480 gray 38.8 54.5 21.5 3.3 19.0 d
yolov5nu_576x576 color 54.2 69.6 36.6 11.0 31.0 j
yolov5nu_576x576 gray 42.7 58.0 26.7 4.6 31.0
-
yolov5n6u_320x320 color 42.0 59.7 20.2 1.0 8.7 k
yolov5n6u_320x320 gray 31.4 46.7 14.2 0.7 8.7 e
-
yolov5su_320x320 color 50.6 67.0 30.9 5.5 10.2 h
yolov5su_320x320 gray 39.4 55.6 21.7 2.6 10.2 c
yolov5su_480x480 color 58.4 73.0 41.9 14.7 37.0 i
yolov5su_480x480 gray 47.1 62.5 31.0 8.2 37.0
-
yolov5s6u_320x320 color 47.8 65.8 25.8 3.0 13.2 k
yolov5s6u_320x320 gray 36.8 53.6 17.1 1.4 13.2 e
-
yolov5mu_320x320 color 59.5 75.3 41.1 10.4 21.5 h
yolov5mu_320x320 gray 51.4 69.1 29.9 4.9 21.5 c
-
yolov5m6u_320x320 color 55.6 73.0 34.7 5.1 27.7 k
yolov5m6u_320x320 gray 49.1 66.7 28.1 3.8 27.7
-
yolov5lu_320x320 color 61.2 76.4 44.3 11.6 33.0 h
yolov5lu_320x320 gray 54.3 71.0 35.0 7.8 33.0
-
yolov5l6u_320x320 color 57.2 74.9 36.4 6.3 45.3 k
yolov5l6u_320x320 gray 50.1 68.3 28.7 5.3 45.3
-
yolov8n_320x320 color 43.8 60.5 23.4 2.1 8.2 l
yolov8n_320x320 gray 29.4 43.9 13.4 1.1 8.2 f
yolov8n_480x480 color 50.3 65.6 32.3 8.5 19.1 m
yolov8n_480x480 gray 36.4 51.3 19.6 4.3 19.1 g
yolov8n_576x576 color 52.0 67.2 34.7 8.9 30.3 n
yolov8n_576x576 gray 37.1 51.9 20.1 6.4 30.3
-
yolov8s_320x320 color 53.6 70.7 33.2 5.6 11.8 l
yolov8s_320x320 gray 43.7 60.6 24.1 2.9 11.8 f
yolov8s_480x480 color 61.3 75.4 45.3 13.2 34.9 m
yolov8s_480x480 gray 52.4 67.9 34.9 7.5 34.9
-
yolov8m_320x320 color 60.6 76.5 41.8 8.8 20.7 l
yolov8m_320x320 gray 52.8 69.8 32.3 5.1 20.7 f
-
yolov9t_320x320 color 48.7 67.5 25.4 2.7 9.3 o
yolov9t_320x320 gray 37.6 55.0 17.8 1.6 9.3 h
yolov9t_480x480 color 56.0 72.1 37.7 9.2 23.5 p
yolov9t_480x480 gray 42.4 59.0 24.2 4.6 23.5 i
yolov9t_576x576 color 57.8 72.4 41.1 12.1 38.2 q
yolov9t_576x576 gray 43.6 59.3 28.0 7.0 38.2
-
yolov9s_320x320 color 55.5 73.1 34.6 6.2 12.4 o
yolov9s_320x320 gray 45.4 63.6 23.9 3.7 12.4 h
yolov9s_480x480 color 62.4 76.4 46.3 18.1 43.0 p
yolov9s_480x480 gray 53.7 69.9 34.6 9.2 43.0
-
yolov9m_320x320 color 60.2 76.4 41.4 10.2 39.1 o
yolov9m_320x320 gray 49.8 66.3 30.9 5.0 39.1
-
yolo11n_320x320 color 43.2 60.3 22.8 3.8 22.2 r
yolo11n_320x320 gray 31.7 46.8 14.3 0.6 22.2
-
cctv1(mobiledet) color 46.6 64.9 24.6 1.8 1.5 s
cctv1(mobiledet) gray 44.1 62.9 21.7 1.2 1.5 j
-
cctv3.3(mobiledet) color 45.6 63.5 22.5 1.8 1.4 t
cctv3.3(mobiledet) gray 45.5 63.6 22.3 2.0 1.4 k
-
cctv4(mobiledet) color 45.5 63.3 23.5 2.2 1.5 u
cctv4(mobiledet) gray 45.7 63.3 23.6 2.4 1.5 l
RPI5 4GB with USB accelerator


TFLITE

MODEL mAP L M S RPI5
mobiledet color 45.2 62.4 23.9 4.7
mobiledet gray 40.2 57.7 17.5 3.0
-
cctv1 color 46.7 64.9 24.6 1.9
cctv1 gray 44.1 62.8 21.7 1.3
-
cctv3.3 color 45.5 63.4 22.3 1.8
cctv3.3 gray 45.6 63.6 22.4 2.0
-
cctv4 color 45.5 63.3 23.5 2.2
cctv4 gray 45.6 63.2 23.5 2.4

Models

The models are based on MobileDet with additional training data added.

CCTV1

Proof of concept model. Can only detect person. Resolution changed from 320x320 to 420x280. Achieves an improvement of 1.7mAP on gray images. Though at the cost of approximately 18% slower inference time.

CCTV2 failed run Frigate compatible model. Can only detect `person`. Resolution changed from `320x320` to `340x340`. Approximately 18% slower inference time. Failed run, accuracy is worse than original model.

CCTV3

Frigate compatible model. Only trained on gray images. Can only detect person. Resolution changed from 320x320 to 340x340. Approximately 18% slower inference speed compared to mobiledet.

CCTV4

Frigate compatible model. Only trained on gray images. Can only detect person. Resolution changed from 320x320 to 340x340. Higher accuracy compared to mobiledet, but much slower inference speed. First model trained without transfer learning.


mAP is the average accuracy. L, M, S is the accuracy for Large, medium, and small boxes.

BASE MODELS

SIZE NAME FULL NAME
320x320 mobiledet ssdlite_mobiledet_edgetpu/fp32

EVAL SETS

COCO Minival

Blacklisted images are removed from all testsets.

IMAGES NAME DESCRIPTION
720 coco-minival_person Minival color and gray, person only.
349 color_coco-minival_person Minival original, cctv1 labels. Gray images removed.
371 gray_coco-minival_person Minival coverted to black and white, person only.

objects365-val-cctv-v1

All images are fairly easy with minimum ambiguity. Count represent the number of images with one or more of the object class.

CLASS COUNT
total 1269
person 684
car 186
elephant 118
giraffe 105
bird 101
dog 101
bicycle 99
cat 93
zebra 80
horse 77
motorcycle 77
train 70
boat 65
cow 21
airplane 19
sheep 16

TRAINSETS

SIZE NAME DESCRIPTION
144k cctv1 person only. Combination of coco2017 and voc2012. Blacklist not applied
144k cctv2 Same as cctv1.
59k cctv3 person only. coco2017 and voc2012 images coverted to gray.
54k cctv3.1 The first 100k person IDs sorted.
50k cctv3.2 The first 200k person IDs sorted.
44k cctv3.3 The first 300k person IDs sorted.
21k cctv4 All COCO person images sorted.

Naming convention.

<TYPE>_<DATASET>_<LABELS>

type description
color Original images.
gray Images converted to black and white.
empty Combined color and gray.

DATASETS

COCO2017

https://cocodataset.org

VOC2012

http://host.robots.ox.ac.uk/pascal/VOC/voc2012/


Resources

https://coral.ai/docs/edgetpu/retrain-detection

Custom object detection from scratch

Effect of batch size on training dynamics

MobileNetV2: Inverted Residuals and Linear Bottlenecks

https://elitedatascience.com/category/explainers

https://stackoverflow.com/questions/64980436/early-stopping-in-tensorflow-object-detection-api/67261510#67261510

https://github.com/minhnhat93/tf_object_detection_multi_channels

https://stackoverflow.com/questions/60537788/how-to-modify-ssd-mobilenet-config-to-detect-small-objects-using-tensorflow-obje

https://stackoverflow.com/questions/52047638/tuning-first-stage-anchor-generator-in-faster-rcnn-model

https://developers.arcgis.com/python/guide/how-ssd-works

https://towardsdatascience.com/understanding-ssd-multibox-real-time-object-detection-in-deep-learning-495ef744fab


Copyright (C) 2021-2025 Curid, Curid@protonmail.com