videoflow
videoflow copied to clipboard
Add an optional argument to the BoundingBoxAnnotator with dict of classes labels
I've added a simple implementation MxnetObjectDetector
to my fork of videoflow-contrib (https://github.com/rominf/videoflow-contrib/commit/ec843363f7f33947dbd12b0cdf57b765f2013132).
I have classes labels in a MxnetObjectDetector._mxnet_model.classes
as a list and want to pass them to the BoundingBoxAnnotator. I think that creating the file with class labels and then reading it is slow and inconvenient.
So, I propose to add class_labels_dict = None
to the BoundingBoxAnnotator.__init__
.
What do you think? If you want, I can do PR.
It makes sense. Just be sure to give preference to one over the other when both class_labels_dict
and class_labels_path
are provided (and to document that case), and to throw an error if none of the two is provided.