videoflow icon indicating copy to clipboard operation
videoflow copied to clipboard

Add an optional argument to the BoundingBoxAnnotator with dict of classes labels

Open rominf opened this issue 4 years ago • 1 comments

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.

rominf avatar Sep 02 '19 15:09 rominf

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.

jadielam avatar Sep 03 '19 12:09 jadielam