Hello, I'm very naive about this field but it would be grateful if you would answer me.
- If you want exactly the current performance just only outputting 1 of the 80 classes, you can just modify the code to ignore the rest of the classes.
- Retraining on just person might give you slightly better performance but you should try 1 first to see if the performance is adequate for you.
Hi,
Could you let me know where to make the changes if I want only a single class?
Thanks in advance
Hello, I'm very naive about this field but it would be grateful if you would answer me.
- Can default yolact pretrained model predict (or export) single class? (not with 80 classes based on COCO dataset)
- If not (or if it would be better performance for single class), I want to train the single class (person class) by myself, but is it best way to use your YOLACT model for single class instance segmentation in realtime?
Hi,
Have you made the changes to run the model for a single class? if so
could you please let me know where to make these changes
So I could run this on only one class to detect and segment
Thanks in advance
At output_utils.py file, inside postprocess function, you can filter the class you want. So you will only return the parameters related to the class you want. Changing like this, you will just draw the class you want, but inference will still be made through all over the classes.
@sree3333 you can make the following changes in the files by applying conditional threshold
1.In eval.py line number 166(according to Sublime text)
2.In layers folder -> output_utils.py line number 42 (according to sublime text editor)
@sree3333 Sorry for leaving you hanging there. What @abhigoku10 works, but you can make the change even sooner to save on NMS computation. After this line
https://github.com/dbolya/yolact/blob/2a11442dab4a5b566cf3ce36ef178e45e146b2d5/layers/functions/detection.py#L83
simply add cur_scores[<everything but your desired class>] *= 0
For the index, if you wanted only person (class 0), you can put 1:, but if you wanted another class than that you'd need to do 2 statements: one with :<class_idx> and the other with <class_idx>+1:. Then when you run eval, run it with --cross_class_nms=True and that'll remove all the other classes from NMS.
Most helpful comment
@sree3333 Sorry for leaving you hanging there. What @abhigoku10 works, but you can make the change even sooner to save on NMS computation. After this line
https://github.com/dbolya/yolact/blob/2a11442dab4a5b566cf3ce36ef178e45e146b2d5/layers/functions/detection.py#L83
simply add
cur_scores[<everything but your desired class>] *= 0For the index, if you wanted only person (class 0), you can put
1:, but if you wanted another class than that you'd need to do 2 statements: one with:<class_idx>and the other with<class_idx>+1:. Then when you run eval, run it with--cross_class_nms=Trueand that'll remove all the other classes from NMS.