cctv-counter-backup / delete_datasets.md
yrarjun's picture
Deletion manifest: record of Tier 3 datasets removed from local disk
815683d verified
|
Raw History Blame Contribute Delete
16.4 kB

Dataset Deletion Manifest β€” CCTV People Counter

Generated: 2026-09-06

Purpose: log every dataset folder being removed from local disk, what was done with it,

and whether it is needed for future workflows (training from scratch, fine-tuning,

inference / Phase 5).


Tier 1 β€” KEPT locally + uploaded to Hugging Face Hub

Rationale: small, critical assets required for inference (Phase 5) and any future

fine-tuning or resume. Upload before local deletion of Tier 3.

1.1 Fine-tuned model weights (trained detector)

Path Approx size What we did with it Future need Status
models/finetuned/person_detector_v1/train_extended/weights/best.pt ~24 MB Best checkpoint from 47-epoch extended run (mot16+COCO combined). mAP50 β‰ˆ 0.739. Used for person detection in Phase 5 pipeline. Required for Phase 5 inference. Also usable as a starting point for future fine-tuning on real venue data (transfer learning). KEEP + UPLOAD
models/finetuned/person_detector_v1/train_extended/weights/last.pt ~24 MB Most recent epoch checkpoint from the same 47-epoch run. Useful if you want to resume training later (e.g. more epochs on real venue data). Optional if you only need inference. KEEP (optional UPLOAD)
models/finetuned/person_detector_v1/train/weights/best.pt ~6 MB Best checkpoint from the earlier Phase 4 run (29 epochs, mAP50 β‰ˆ 0.205 then 0.709 at epoch 1). Lower-value backup; useful for comparison or as a fallback if the extended run is somehow corrupted. Not required for Phase 5. KEEP + UPLOAD (optional)

1.2 Pretrained base weights

Path Approx size What we did with it Future need Status
models/pretrained/yolov8n.pt ~6 MB Official YOLOv8n base weights used as the starting point for fine-tuning (Phase 4 / 4b). Required if you ever fine-tune from scratch again (new dataset needs a base checkpoint). Not needed for Phase 5 inference (which uses your fine-tuned best.pt). KEEP + UPLOAD

1.3 Config files

Path Approx size What we did with it Future need Status
config/counting_config.yaml ~? KB Line-zone / counting config for Phase 5–6 pipeline. Required for Phase 5 pipeline runs. KEEP + UPLOAD
config/exclusion_config.yaml ~? KB Zone exclusion config for Phase 7. Required for future zone-exclusion work. KEEP + UPLOAD

1.4 Dataset YAML definitions (small metadata files describing dataset layout)

Path Approx size What we did with it Future need Status
data/annotated/dataset.yaml 378 B Original MOT16 dataset YAML pointing to images/train + images/val. Defines how the original MOT16 split was laid out. Useful reference when re-ingesting or verifying dataset structure later. KEEP + UPLOAD
data/annotated/dataset_coco.yaml 624 B COCO person-only dataset YAML. Reference for COCO-derived labels. Useful if you later add more COCO data or re-create the combined dataset. KEEP + UPLOAD
data/annotated/dataset_combined.yaml 485 B Combined dataset YAML (MOT16 + COCO). Note: the paths inside may reference folders that no longer exist after deletion; keep as a record of the intended layout. Reference. Not directly usable for training after raw datasets are deleted, but documents the combined schema. KEEP + UPLOAD

1.5 Scripts (pipeline / conversion / training)

Path Approx size What we did with it Future need Status
scripts/fine_tune.py ~? KB Fine-tuning orchestrator. Handles resume (last.pt detection), epoch checkpoint naming (train/ vs train_extended/), LR, patience, etc. Required if you ever resume/repeat fine-tuning. KEEP + UPLOAD
scripts/create_combined_dataset.py ~? KB Merges MOT16 train + COCO person + COCO background into combined train set (88,165 images). Required if you rebuild the combined dataset from raw sources in the future. KEEP + UPLOAD
scripts/coco_to_yolo.py ~? KB Converts COCO annotations (person class only) to YOLO txt format; also samples background-only images. Required if you process new COCO-derived data. KEEP + UPLOAD
scripts/regen_mot16_val_labels.py ~? KB Regenerates MOT16 val labels from GT files (used to fix broken symlinks). Useful if MOT16 val labels ever go missing. KEEP + UPLOAD
scripts/pets_to_yolo.py ~? KB Converts PETS 2009 annotations to YOLO format. Useful if you ever re-add PETS data. KEEP + UPLOAD

Tier 2 β€” KEPT locally + uploaded to Hugging Face Hub

Rationale: the actual training corpus used (or intended) for fine-tuning. Back up in

full before deleting raw sources, so future re-training is possible without

re-downloading 20+ GB of public data.

2.1 Annotated training corpus (processed images + labels)

Path Approx size File count What we did with it Future need Status
data/annotated/images/ (all subdirs) ~11 GB ~68,903 files (incl. duplicates) Processed/symlinked copies of MOT16 train+val, COCO person, COCO background, PETS, and empty venue-frames. Fed to the YOLOv8 trainer as the image source in Phase 4 / 4b. Needed if you ever retrain or fine-tune again from scratch on the same corpus (or a superset). NOT needed for Phase 5 inference (only best.pt is needed). KEEP locally + UPLOAD to HF (full tree, ~11 GB)
data/annotated/labels/ (all subdirs) ~0.05 GB ~178,194 files YOLO-format txt labels for the annotated images. Paired with images above; same rationale. Critical for any future training on this corpus. KEEP + UPLOAD

2.2 Subfolder breakdown (for reference β€” upload as one tree, do not split)

Subfolder Images Labels Notes
coco_train/ 84,211 84,211 Clean COCO person subset (img+label pairs match).
combined_train/ 88,165 88,165 NOT clean: only 3,954 img+label basenames match; 64,449 images have no paired label. Legacy merged folder β€” keep for completeness but do not treat as a ready-to-train pair set.
pets_train/ 0 0 Empty (PETS data lives in raw/; processed copy is empty here).
test_empty/ 500 ? (likely 0 or stub) Empty-venue frames; used for TN/negative mining concept. Check label count before relying on it for training.
train/ 3,954 3,954 MOT16 training split (clean pair set, symlinked from raw/MOT16).
val/ 1,362 1,362 MOT16 validation split (clean pair set).

Upload recommendation: upload the entire data/annotated/ directory tree (images + labels + the 3 YAML files already in Tier 1) as a single HF dataset repo or as a folder inside a model repo. That preserves every subset and its messy overlaps, so future-you can pick the clean subset (coco_train, train, val) without loss.


Tier 3 β€” DELETED locally (NOT uploaded; can be re-downloaded if ever needed)

Rationale: large raw/public datasets that are either redundant with the annotated

corpus or re-downloadable. Deleting frees ~24 GB on a 94%-full C: drive.

All are recoverable from public sources (COCO, MOT16, PETS) if needed later.

3.1 Raw COCO 2017 (train + val + annotations)

Path Size File count What we did with it Future need if deleted Re-download source Status
data/raw/COCO/ 20.96 GB ~123,293 files (includes annotations JSONs, JPEG zips already extracted) Source for COCO person images (15,000 sampled) + 5,000 background-only images used in Phase 4b extended training. Converted by coco_to_yolo.py into COCO person labels and background labels; results ended up in data/annotated/coco_train/ and data/annotated/labels/coco_train/. If deleted: you can re-download COCO 2017 from the official source (cocodataset.org) or from Hugging Face datasets (e.g. huggingface.co/datasets/coco). The conversion scripts (Tier 1) are kept, so rebuilding annotated COCO labels is possible but would take time and bandwidth. For Phase 5 inference: NOT needed. For future training from scratch using COCO backgrounds: needed again unless you already have the 5,000 background images preserved elsewhere. Public: cocodataset.org or HF datasets DELETE locally after Tier 2 upload

3.2 Raw MOT16 (train + test, with GT detections)

Path Size File count What we did with it Future need if deleted Re-download source Status
data/raw/MOT16/ ~1.9 GB ~11,270 files Source MOT16 frames + ground-truth detection files. MOT16 train frames were symlinked into data/annotated/images/train/ (3,954 images) and their GT labels converted to YOLO format in data/annotated/labels/train/. If deleted: you lose the raw frames, but data/annotated/images/train/ + labels/train/ retain the 3,954 training pairs. For Phase 5 inference: NOT needed. For future retraining on MOT16: you'd re-download MOT16 (e.g. from MOTChallenge) and re-run the conversion symlinks. Low marginal cost to re-download (~1.9 GB). Recommended to delete since the processed version is in Tier 2. MOTChallenge (motchallenge.net) or HF DELETE locally after Tier 2 upload

3.3 Raw PETS 2009

Path Size File count What we did with it Future need if deleted Re-download source Status
data/raw/PETS2009/ small (measured: 123 files, size not large) ~123 files PETS benchmark frames + annotations. Converted by pets_to_yolo.py; results were supposed to land in data/annotated/pets_train/ (which is currently empty β€” conversion may not have completed or was never run). If deleted: PETS is a small public benchmark; re-downloadable if you ever need it. Current annotated/pets_train/ is empty, so deleting raw PETS has no immediate loss. Low priority to keep. Public PETS benchmark site DELETE locally (after confirming no dependency)

3.4 Normalized MOT16 intermediate output

Path Size File count What we did with it Future need if deleted Status
data/normalized/ 1.98 GB ~11,243 files Intermediate output of MOT16 β†’ YOLO normalization step (likely a copy/symlink tree of MOT16 images reorganized for training). Overlaps with data/raw/MOT16/ and data/annotated/images/train/. If deleted: redundant with raw/MOT16 and annotated/train. Not needed for Phase 5 inference. Safe to delete β€” it was an intermediate artifact, not a final dataset. N/A (regenerable from raw/MOT16)

Model checkpoint bloat β€” DELETED locally (NOT datasets, but disk hogs)

Rationale: epoch-by-epoch checkpoint files consume ~1 GB total across two training runs.

Only best.pt + last.pt are needed for inference / resume.

4.1 Phase 4 run checkpoint intermediates (train/ weights)

Path pattern Approx total What we did with it Future need Status
models/finetuned/person_detector_v1/train/weights/epoch{0..16}.pt ~150–250 MB total (17 files) Per-epoch checkpoints from the earlier 29-epoch Phase 4 run. Not needed for inference. Only best.pt (~6 MB) and last.pt are useful for potential resume. If you plan to resume this specific run later, keep last.pt; otherwise delete all epoch files. DELETE epoch files; KEEP best.pt + last.pt

4.2 Phase 4b extended run checkpoint intermediates (train_extended/ weights)

Path pattern Approx total What we did with it Future need Status
models/finetuned/person_detector_v1/train_extended/weights/epoch{0..48}.pt ~600 MB–1 GB total (49 files) Per-epoch checkpoints from the 47-epoch extended run (the one with mAP50 β‰ˆ 0.739). Not needed for inference. best.pt is the converged model; last.pt is the resume fallback. If you might resume this run later (e.g. continue training on real venue data), keep last.pt. Otherwise delete all epoch files to free ~1 GB. DELETE epoch files; KEEP best.pt + last.pt

Summary of deletions (local disk)

Delete? Path Size saved Notes
YES data/raw/COCO/ ~20.96 GB Largest win; re-downloadable from COCO/HF if ever needed.
YES data/raw/MOT16/ ~1.9 GB Redundant with annotated/train; re-downloadable from MOTChallenge.
YES data/raw/PETS2009/ small Public benchmark; annotated/pets_train/ is currently empty.
YES data/normalized/ ~1.98 GB Intermediate artifact; regenerable from raw/MOT16.
YES models/.../train/weights/epoch{0..16}.pt ~0.2 GB Keep best.pt + last.pt only.
YES models/.../train_extended/weights/epoch{0..48}.pt ~0.8 GB Keep best.pt + last.pt only.
Total potential space freed ~25–27 GB Before deleting, verify Tier 1 + Tier 2 are uploaded to HF.

What is NOT deleted (kept locally, regardless of HF upload)

  • models/finetuned/person_detector_v1/train_extended/weights/best.pt (~24 MB) β€” primary detector for Phase 5.
  • models/finetuned/person_detector_v1/train_extended/weights/last.pt (~24 MB) β€” resume fallback (keep unless you are sure).
  • models/finetuned/person_detector_v1/train/weights/best.pt (~6 MB) β€” earlier run backup.
  • models/pretrained/yolov8n.pt (~6 MB) β€” base weights for any future fine-tuning.
  • config/ (both YAMLs).
  • scripts/ (all .py files).
  • data/annotated/dataset.yaml, dataset_coco.yaml, dataset_combined.yaml.
  • data/annotated/images/ (full tree β€” Tier 2).
  • data/annotated/labels/ (full tree β€” Tier 2).
  • The CCTV test videos in dumps/video/ (1.mp4–9.mp4).
  • All source code: src/, run_pipeline.py, verify_test.py, pyproject.toml, requirements.txt, etc.

Future-workflow decision guide

Phase 5 (current): Multi-Object Tracking Integration (BoT-SORT)

  • Requires: fine-tuned best.pt (Tier 1), config/, scripts/, src/, test videos.
  • Does NOT require: any raw datasets, annotated images/labels, or epoch checkpoints.
  • Action: after Tier 2 upload, you can safely delete all Tier 3 + epoch bloat and still run Phase 5.

Future: Fine-tuning on real venue data (when it arrives)

  • Requires: base yolov8n.pt (Tier 1) OR an existing fine-tuned checkpoint to resume from (best.pt / last.pt from Tier 1), plus the new venue images + labels (to be collected), plus fine_tune.py (Tier 1).
  • Does NOT require: COCO raw, MOT16 raw, PETS raw, normalized, or the old annotated corpus β€” unless you want to mix old data with new venue data.
  • If you want to keep the ability to re-mix old COCO backgrounds with new venue data: keep the COCO-to-YOLO conversion script (Tier 1) and consider keeping the 5,000 background images (they may be in annotated/coco_train or test_empty β€” check which subfolder holds them before deleting). The COCO raw (20.96 GB) can be deleted because the sampled backgrounds are already in annotated/ (Tier 2).
  • If you never plan to reuse COCO/MOT16/PETS again: deleting Tier 3 is zero-risk.

Future: Training from scratch on a new dataset

  • Requires: yolov8n.pt (Tier 1) as the base, a new dataset YAML + images + labels (to be created from your venue data), and fine_tune.py (Tier 1).
  • Does NOT require: any of the old data. Tier 3 deletion is safe.
  • If you also want the option to re-create the old combined dataset exactly (e.g. for reproducibility): keep Tier 2 (annotated/) on HF, and keep the conversion scripts (Tier 1). You would still need to re-download COCO raw + MOT16 raw to rebuild from scratch, but the scripts + YAMLs + annotated backup give you a recovery path.

Recommendation for maximum future flexibility with minimum local footprint:

  1. Upload Tier 1 (models + config + scripts + YAMLs, ~60 MB) to HF Hub.
  2. Upload Tier 2 (data/annotated/ full tree, ~11 GB) to HF Hub as a backup dataset repo.
  3. Verify both uploads landed correctly.
  4. Delete all Tier 3 (raw COCO/MOT16/PETS, normalized) + epoch checkpoint bloat locally.
  5. Keep Tier 1 locally as well (so Phase 5 runs without downloading from HF each time).

This leaves you with ~25–27 GB freed locally while retaining a full recoverable backup on HF and everything Phase 5 needs locally.