Allow detectron model to manually setup metadata instead of setting it as MetadataCatalog.get(cfg.DATASETS.TRAIN[0])
#620
Replies: 2 comments
-
@snapcart-ruben nice discussion! Why did you close it, did you somehow solve it? |
Beta Was this translation helpful? Give feedback.
-
oh it was supposed to be moved back to draft but I might have pressed close instead.. Thank you for acknowledging! hmm, it wasn't fullproof-ed regarding the result of limiting Line 654 in b93132d I had to read back the documentation for Detectron models. On the other note, the rest of the details still stands. Meaning allowing user-defined [keyworded] arguments in either the parent or child classes of the the Thank you! |
Beta Was this translation helpful? Give feedback.
-
Firstly, thanks for creating this repo as I was also trying to mimic video buffer just to achieve the per slice detection of static image. It was somehow a success but speed and final accuracy isn't achieved.
As per my title, I'd like to suggest to allow manual setup of metadata to the
Detectron2DetectionModel.load_model
method. Specifically,sahi/sahi/model.py
Line 539 in b93132d
Though manually setting
category_mapping
parameter is a way to update the final result, it doesn't guarantee the 100% capture rate of the prediction, albeit over-prediction due to missing metadata.Specifically, the
warning
generated by missing metadata:As a solution, I have to add (override) this line into the
load_model
method:In some cases (especially in prediction),
And to some extent, the
cfg.DATASETS
need not to be loaded at all.In general, (aside from Detectron) it would be great to have independent
__init__(*args, **kwargs)
method for each subclass (inheriting fromDetectionModel
class) preserving the parent (super.__init__()
).If (1) isn't a good option, On Detectron, to add
thing_classes: List[str]
as a parameter with catch code ifNone
is provided:Thank you and more powers to the team!
Beta Was this translation helpful? Give feedback.
All reactions