pytorch / vision

Datasets, Transforms and Models specific to Computer Vision
https://pytorch.org/vision
BSD 3-Clause "New" or "Revised" License
16.09k stars 6.94k forks source link

Add typing annotations to models/detection #4582

Open oke-aditya opened 3 years ago

oke-aditya commented 3 years ago

🚀 The feature

This is an issue to track down all the files in detection module and work up the chain.

To type the models, all the above files would need to have annotations.

Motivation, pitch

@khushi-411 and I will sync and work on these files.

Solving This issue also helps #2025

As first step I'm closing #4220 and splitting it up into multiple PRs preferably one file each.

Hopefully we should complete this soon.

Alternatives

Note that there are cases where we have make JIT happy over mypy.

Most of these cases occur as JIT does not Support Tuple fully. In most cases we should prefer List.

Additional context

cc @datumbox @pmeier @NicolasHug

datumbox commented 3 years ago

Sounds goo.d I think SSD and SSDlite are mostly done. We are missing a couple of return types but parameters should be in place.

khushi-411 commented 3 years ago

Let's start with other files too! @oke-aditya, have you started with any of them?

I'm moving ahead with backbone_utils.py. Please ping me if you have taken it up.

oke-aditya commented 3 years ago

Go ahead :smile: Just remember that after #4583 is merged you would need to remove that file from mypy.ini configuration.