lufficc / SSD

High quality, fast, modular reference implementation of SSD in PyTorch
MIT License
1.52k stars 384 forks source link

own dataset test #174

Closed ShiqiSong closed 3 years ago

ShiqiSong commented 4 years ago

Hi,I have trained the model on my own datasets,but how can i test my trained result? if isinstance(dataset, MyDataset): return my_own_evaluation(**args) how to code the "my_own_evaluation" function ?could you help me?

priteshgohil commented 4 years ago

Hi @ShiqiSong , It is very easy to evaluate on your own dataset with just littel changes. All you need to do is following,

  1. Create your cutomDataset folder in ssd/data/datasets/evaluation
  2. Copy and paste [init.py] (https://github.com/lufficc/SSD/blob/master/ssd/data/datasets/evaluation/voc/__init__.py) to evaluate on VOC dataset.
  3. Next, rename function definition. Now arrange your GT and predictions similart to __init__.py file.
  4. Only important part is to read your ground truth from dataloader and customize get_annotation() function in your dataloader. https://github.com/lufficc/SSD/blob/50373c79b861d5d239be4206fafc6661cea040b4/ssd/data/datasets/evaluation/voc/__init__.py#L21 Your ground truth should be xyxy format and it should be with respect to your input image size.
  5. You might also return image H,W in 4th step. It will be used to resize prediction boxes to your image size.
  6. Pass these values to eval_detection_voc() function. https://github.com/lufficc/SSD/blob/50373c79b861d5d239be4206fafc6661cea040b4/ssd/data/datasets/evaluation/voc/__init__.py#L35