Comments (5)
Hi,
This is a great question.
Indeed, COCO only has 80 classes, but they are not contiguous in their class indices. Indeed, as you can see from the colab notebook (which contains the class names), there are many N/A
classes
CLASSES = [
'N/A', 'person', 'bicycle', 'car', 'motorcycle', 'airplane', 'bus',
'train', 'truck', 'boat', 'traffic light', 'fire hydrant', 'N/A',
'stop sign', 'parking meter', 'bench', 'bird', 'cat', 'dog', 'horse',
'sheep', 'cow', 'elephant', 'bear', 'zebra', 'giraffe', 'N/A', 'backpack',
'umbrella', 'N/A', 'N/A', 'handbag', 'tie', 'suitcase', 'frisbee', 'skis',
'snowboard', 'sports ball', 'kite', 'baseball bat', 'baseball glove',
'skateboard', 'surfboard', 'tennis racket', 'bottle', 'N/A', 'wine glass',
'cup', 'fork', 'knife', 'spoon', 'bowl', 'banana', 'apple', 'sandwich',
'orange', 'broccoli', 'carrot', 'hot dog', 'pizza', 'donut', 'cake',
'chair', 'couch', 'potted plant', 'bed', 'N/A', 'dining table', 'N/A',
'N/A', 'toilet', 'N/A', 'tv', 'laptop', 'mouse', 'remote', 'keyboard',
'cell phone', 'microwave', 'oven', 'toaster', 'sink', 'refrigerator', 'N/A',
'book', 'clock', 'vase', 'scissors', 'teddy bear', 'hair drier',
'toothbrush'
]
The simplest way to handle this is just to consider the max class id (in this case it's 90), which would make for 91 classes.
This is the approach that torchvision does as well, and simplifies the rest of the code as we don't need to carry a class mapping, like we did for maskrcnn-benchmark
or detectron2
.
I hope I have clarified this point, as as such I'm closing the issue, but let me know if you have further questions.
from detr.
from detr.
Hi, fmassa,
Thank you for your quick reply.
(1)I want to confirm that 'the valid categories are 80'. But you set it=90+1(bg).
Does it indicate that there are 10 categories that are invalid(e.g. "N/A", also no data belong to these categories)?
(2)If one does class mapping(e.g. 'mmDetection', the num_class=80, no invalid categories), the network output is also 80(or 81).
Will your approach(having 10 invalid categories) have different performance with mmDetection(remove invalid categories, only 80 valid categories)?
from detr.
Does it indicate that there are 10 categories that are invalid(e.g. "N/A", also no data belong to these categories)?
Yes, this means that there are 10 categories that do not have any corresponding training element, and thus are never predicted by the model.
Will your approach(having 10 invalid categories) have different performance with mmDetection(remove invalid categories, only 80 valid categories)?
From experiments with torchvision (which also uses 91 classes), the results match Faster R-CNN, so there is no difference in performance due to that. We just have a few more parameters in the model in the last classifier which are unused.
from detr.
@fmassa
Great, thank you. It really solved my question.
from detr.
Related Issues (20)
- .cpu() operation as bottleneck in training
- Question about gradient backpropagation to object queries.
- Q: Encoder
- Concat 3 datasets on DETR
- mAP on new images using trained model
- How to train with many objects HOT 2
- Bounding Boxes do not seem correct
- Why need to freeze for segmentation task after training the normal box model? HOT 1
- How to convert DETR into a detection frame that can detect rotation?
- max_size do not work in RandomResize()
- [CRASH!] System crash/reboot on RTX 4090 HOT 2
- I know the problem is caused by COCO label.json file, but have no clue how to solve it HOT 1
- what exact command you run:FutureWarning: The module torch.distributed.launch is deprecated HOT 2
- It looks that DETR training time is longer than YOLO, HOT 2
- first decoder_layer input different with paper HOT 2
- Convert model to TorchScript
- using --resume, I encounter a strange problem. HOT 3
- Error in loading weights from Model Zoo
- How can I use DETR to detect rotated bbox HOT 1
- Sigmoid in bounding boxes prediction? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from detr.