detecto
detecto copied to clipboard
Forward all image objects at once instead of single object
Hi there. I'd like to know why forward only one object from an image at once? Doesn't it wrong cause it penalizes another true detected objects which is not in your targets?
For example I have an image with a 15 objects.
Now we forward every time with only one object like that:
target = [{'boxes': torch.tensor([[345, 191, 369, 204]]), 'labels': ['cat']}]
Why we cannot construct a target for all objects in the image like this?
target = [{
'boxes': torch.tensor([[154.1306, 209.2777, 175.7699, 220.8761],
[400.9026, 75.6102, 435.0026, 97.2690],
[300.3522, 77.9024, 342.0962, 99.5374],
[100.9261, 91.8649, 136.6947, 116.0395],
[490.7898, 212.4188, 511.1520, 225.7012],
[120.4079, 151.2391, 141.3405, 164.4484],
[518.1366, 124.5545, 538.5353, 138.7017],
[226.5043, 89.2378, 259.0278, 114.6481],
[ 93.8250, 242.2077, 117.7525, 254.9148],
[277.7056, 157.6328, 299.1886, 169.3138],
[345.6203, 191.2927, 370.4335, 204.7901],
[418.2974, 117.0767, 437.9148, 129.0135],
[ 77.0144, 148.9221, 93.8439, 159.8789],
[ 51.7220, 280.8792, 71.1462, 291.9274],
[534.0248, 230.2854, 554.2579, 237.8878]]),
'labels': ['cat'] * 15
}]
Thankx in advance.
Could you clarify the code or situation in which this happens?
If you're using the core.Dataset class I think it should have been fixed in PR #62 and release v1.2.0