open-mmlab / mmdetection

OpenMMLab Detection Toolbox and Benchmark
https://mmdetection.readthedocs.io
Apache License 2.0
29.54k stars 9.46k forks source link

[Feature Request] Add LoadImageFromNdarray alias for LoadImageFromWebcam #7171

Open nijkah opened 2 years ago

nijkah commented 2 years ago

Describe the feature

Motivation LoadImageFromWebcam is not easy to understand how it works. Actually it transform ndarray to default mmdetection data format.

So I think it is good idea to add alias as LoadImageFromNdarray. implementation will be like just below

# end of the mmdet.datasets.pipelines.py
LoadImageFromNdarray = LoadImageFromWebcam

If it seems good idea, I will create the PR.

jbwang1997 commented 2 years ago

Thanks for your suggestions. I find LoadImageFromNdarray has existed in mmocr. So, it may cause some confusion.

nijkah commented 2 years ago

Do you mean LoadImageFromNdarray(LoadImageFromWebcam) in mmdet will be confused with LoadImageFromNdarray in mmocr? They are only different in color_type variable, which is used for transforming an image. I think it is more natural to separate "color_type transform" from LoadImageFromNdarray in mmocr.

ZwwWayne commented 2 years ago

Invite @gaotongxiao to take a look

ZwwWayne commented 2 years ago

Hi @nijkah , Thank you for the kind suggestion. It is indeed more natural to name it as LoadImageFromNdarray. However, for now, since MMOCR implements this module and it directly uses the registry of MMDet, simply adding a new module in mmdet with a similar name will make MMOCR cannot run. We are considering the modification of the registry so as this feature request, but it will take some time.

gaotongxiao commented 2 years ago

It's okay to submit a PR for now, but it won't be merged utill April.