Closed brimoor closed 3 years ago
I really don't want people to have to think about the model configs when they just want to run a model.
Why not just set a default value of 0.1 to the confidence_thresh
kwarg in apply_model()
?
Yeah I suppose that might be the easiest solution. My two reservations on that approach were that:
confidence
may have different meanings for certain models. But I guess it is easy enough for the user to override the default in such cases.apply_model(..., confidence=)
is applied post-inference, which means that the offending models that generate tons of predictions would do a bit of extra work to construct Label
objects that would then be thrown away. Our data model is a bit slow at times right now, so that may introduce some undesirable performance overhead. But, I think I have a clever solution to avoid that (internally set model.config.confidence
if possible before using the model).Thanks for the nudge to think about making apply_model(..., confidence=)
work.
Due to implementation details, some detection models in the zoo like
rfcn-resnet101-coco-tf
andssd-inception-v2-coco-tf
always emit a very large number (300 and 100, respectively, in these cases) of detections for every image. This is undesirable because it makes the raw output unreadable in the App and makes theSample
objects pretty huge, which causes things to be slow.The
Dataset.apply_model()
method accepts an optionalconfidence_thresh
argument that enables controlling the confidence threshold for any model, but many models also support a parameter likeconfidence_thresh
directly in their associatedConfig
files, so we could hard-code a low confidence threshold like 0.1 in the model zoo manifests, so that the default syntaxdataset.apply_model(model)
would result in reasonable behavior:The only concern here is that some use cases like PR curves may want every detection to be available. The user could recover this behavior as follows:
although this is a bit undocumented. I tried to make
model.config.confidence_thresh
available on almost all models, but it's not formally defined in thefiftyone.core.models.Model
interface.Example raw output from offending models:
And result after filtering with confidence >= 0.1: