sovit-123 / fasterrcnn-pytorch-training-pipeline

PyTorch Faster R-CNN Object Detection on Custom Dataset
MIT License
223 stars 75 forks source link

Does your Dataset class cope with empty frames? #55

Open GeorgePearse opened 1 year ago

GeorgePearse commented 1 year ago

I often use this repo as a point of reference.

boxes = [] 
boxes = torch.as_tensor(boxes, dtype=torch.float32)

I don't believe the above would create the required shape to be provided to Faster RCNN in the case of an empty frame. See https://stackoverflow.com/questions/66063046/how-to-train-faster-rcnn-on-dataset-including-negative-data-in-pytorch .

Does your dataset / model cope with empty frames in some other way? Just trying to find what's considered sensible practice.

https://github.com/pytorch/vision/issues/1598

sovit-123 commented 1 year ago

@GeorgePearse Yes, it handles empty frames. This part in datasets.py handles it.