dbolya / tide

A General Toolbox for Identifying Object Detection Errors
https://dbolya.github.io/tide
MIT License
706 stars 115 forks source link

Feature Request: Finish statically typing the API #36

Open drewm1980 opened 3 years ago

drewm1980 commented 3 years ago

To start, the type annotations in your code are a huge advantage of this over pycocotools; thanks for adding annotations!

That said, some arguments to API functions are not fully statically typed. The type instability in the pycocotools API is unfortunate, but in your wrapper you can use Union types to, i.e. represent the switching between compressed and non-compressed masks in overloaded methods Data.add*

Thanks!

drewm1980 commented 3 years ago

I am also spending a lot of time figuring out what the output types of your functions are. It would be nice to have static types for the outputs of: TIDE.get_*_errors instead of deeply nested mystery dicts. Note that I'm talking about actual types(classes) with statically known field names, not annotating the outputs as Dict or Dict[Dict[object, object]].