yhenon / pytorch-retinanet

Pytorch implementation of RetinaNet object detection.
Apache License 2.0
2.14k stars 664 forks source link

About Torchvision #22

Closed ghost closed 5 years ago

ghost commented 6 years ago

Hi, I am using the UA-DETRAC datasets which aims for the vehicle detection.There are some confusion in my mind when i use CSV loader to load the dataset with RESNET 50 for training.I wonder when doing datas transform with the torchvision,why the "Normalizer()"'s mean and std has the constant value of [0.485, 0.456, 0.406] and [0.229, 0.224, 0.225].Furthermore the "Resizer()" is implemented when the datasets is COCO which has the different image size,but the UA-DETRAC datasets has the same image size.I want to know whether should i need do the Resizer.

yhenon commented 6 years ago

Hi,

I hope you find this repo useful.

why the "Normalizer()"'s mean and std has the constant value of [0.485, 0.456, 0.406] and [0.229, 0.224, 0.225]

I am using the pytorch pretrained resnet model, which was trained with those normalization values (which are the imagenet means and standard deviations I believe).

Furthermore the "Resizer()" is implemented when the datasets is COCO which has the different image size,but the UA-DETRAC datasets has the same image size.I want to know whether should i need do the Resizer

In accordance with the retinanet paper, we resize images such that the smaller side is 600px, but the larger side no longer than 1024 pixels. You can adjust the resizer: but make sure the aspect ratio of your images is preserved. (if your images are fixed size, just replace the 600 and 1024 by the values you'd like).

ghost commented 6 years ago

I am so sorry to bring this up so late and very glad to receive your reply.I am going to change the resizer to my own datasets. Thanks a lot.I will continue to pay attention.