Add Gen2 Class Saver (JPEG) - #62
Conversation
|
This is a really useful example, on top of existing Mobilenet SSD Object detection! MobileNet SSD's are bias with some classes, which is prevalent in almost all models. This leads to creating false positives which are unidentified while seeing the visualisation, but can be observed when 30frames in a second are split and observed. This example is saving nearly 30 Frames a second (If an object is detected in frame), which creates many some positives - (an example here) All these detections aren't evident in the preview output, however nearly hundreds of them are saved to the folder while running the detection nearly for a minute. This accounts to these being detected total of 3seconds in a 60second time frame. Also since the detections are continuous, nearly 30 detected frames are stored each second, one with bounding boxes in the total frame, and the other image with the image inside the bounding box area - total of 60 frames. Upon calculating, total data stored within a minute of detection, it is nearly 90Mb. So here is a suggestion (Not really sure on this, and the existing method might turn out to be better) Although I also noticed that this is really useful for saving frames of classes which are not evident in the preview imshow, like Thanks! |
|
Is there a bug where the detection threshold isn't being used to save the JPEGs? |
|
Sometimes the issue is really simple, haha. Detection threshold should do the work |
|
Thanks. Did that fix it? |
|
Will try it today |
|
Great thanks! |
|
So, I was trying the fix right now. Seems that the confidence threshold is already implemented, and it is filtering objects detected below 50% threshold |
|
Thanks. So maybe would it be a good idea to do one of two, or perhaps both things:
Thoughts? Thanks, |
|
Seems like a good idea. Will try a few of them, and let's see what's best |
|
Great thanks! |



Gen2 Class Saver (JPEG)
This example demonstrates how to run MobilenetSSD and collect images of detected objects, grouped by detection label.
After running this script, DepthAI will start MobilenetSSD, and whenever it detects objects, it will add a dataset entry
Dataset is stored under
datadirectory, and a main dataset file is located underdata.dataset.csv.For each detected object, a new dataset entry is created, with each entry having files with a precise purpose:
timestampusesint(time.time() * 10000)to store a timestamp of the capture. Please note that this value can be duplicated, if multiple objects are detected on a single imagelabelis a human-readable label of the detected objectleft,top,right,topare object bounding box coordinatesraw_framerepresents a path to raw RGB frame captured on DepthAI when detection occuredoverlay_framerepresents a path to RGB frame with detection overlays (bounding box and label)cropped_framerepresents a path to cropped RGB frame containing only ROI of the detected objectAn example entries in
dataset.csvare shown belowDemo
Side note:
I was wondering if I should record the demo video with a some lamps turned on, but I think this also shows that detection in fairly low-light levels is possible. Any thoughts?