Probieren geht über…
An das Projekt von Mat Kelcey hab ich mich zwar immer noch nicht herangetraut, dafür ließen sich mit einem anderen ein paar schnelle Schnappschüsse gewinnen, basierend auf:
Sinvoll anwenden kann man das so ohne weiteres nur auf einem stärkeren Rechner.
Setup
git clone https://github.com/roboflow-ai/zero-shot-object-tracking.git
cd zero-shot-object-tracking/
# Slightly adjust `requirements.txt`.
# ftfy>=6,<7
# Delete `regex`.
git clone https://github.com/openai/CLIP.git CLIP-repo
cp -r ./CLIP-repo/clip ./clip
python3 -m venv .venv
source .venv/bin/activate
pip install --upgrade pip
pip install -r requirements.txt
Synopsis, auf den Demo Videos
python clip_object_tracker.py --weights models/yolov5s.pt --detection-engine yolov5 --info \
--source data/video/fish.mp4
python clip_object_tracker.py --weights models/yolov5s.pt --detection-engine yolov5 --info \
--source data/video/cars.mp4
Synopsis, auf einem beliebigen Video mit Bienenflugaktivität
youtube-dl https://www.youtube.com/watch?v=By146BSweog --format=136
time python clip_object_tracker.py --weights models/yolov5s.pt --detection-engine yolov5 --info \
--source beevideo/Flight\ of\ the\ honeybee-By146BSweog.mp4
Ergebnis: https://ptrace.hiveeyes.org/2022-02-21_honeybee-flight-clip.mp4
Wenn Ihr weitere oder bessere Anflug- oder Fluglochvideos habt, verlinkt sie gerne hier im Beitrag.
Details
Die Maschinerie erkennt die Objekte und verfolgt sie über die Zeit, wie im annotierten Video zu sehen. Auf der Konsole sieht die Log-Ausgabe unterdessen folgendermaßen aus (pro Frame ein Eintrag):
[Detections]
1 birds, 1 dogs, 3 kites,
[Tracks] 8
Tracker ID: 2, Class: kite, BBox Coords (xmin, ymin, xmax, ymax): (621, 478, 874, 634)
Tracker ID: 12, Class: bird, BBox Coords (xmin, ymin, xmax, ymax): (213, 238, 261, 315)
Tracker ID: 17, Class: kite, BBox Coords (xmin, ymin, xmax, ymax): (437, 140, 471, 170)
Done. (0.182s)
video 1/1 (58/1319) /Users/amo/dev/foss/zero-shot-object-tracking/beevideo/Flight of the honeybee-By146BSweog.mp4: yolov5 inference
[Detections]
1 birds, 1 kites,
[Tracks] 6
Tracker ID: 2, Class: kite, BBox Coords (xmin, ymin, xmax, ymax): (638, 479, 882, 629)
Tracker ID: 12, Class: bird, BBox Coords (xmin, ymin, xmax, ymax): (213, 230, 262, 308)
Tracker ID: 17, Class: kite, BBox Coords (xmin, ymin, xmax, ymax): (430, 141, 463, 170)
Done. (0.187s)
video 1/1 (59/1319) /Users/amo/dev/foss/zero-shot-object-tracking/beevideo/Flight of the honeybee-By146BSweog.mp4: yolov5 inference
[Detections]
1 birds, 1 kites,
[Tracks] 6
Tracker ID: 12, Class: bird, BBox Coords (xmin, ymin, xmax, ymax): (208, 223, 259, 304)
Tracker ID: 17, Class: kite, BBox Coords (xmin, ymin, xmax, ymax): (422, 140, 457, 171)
Done. (0.218s)
video 1/1 (60/1319) /Users/amo/dev/foss/zero-shot-object-tracking/beevideo/Flight of the honeybee-By146BSweog.mp4: yolov5 inference