zzzxxxttt / pytorch_simple_CenterNet_45

A simple pytorch implementation of CenterNet (Objects as Points)
308 stars 63 forks source link

Train centernet with custom dataset #17

Closed ashley-mv closed 4 years ago

ashley-mv commented 4 years ago

Hi, Could you please add what are the steps required to train this network for a new dataset and classes?

zzzxxxttt commented 4 years ago
  1. convert your data and annotation into pascal or coco format.
  2. in datasets/pascal.py (or datasets/coco.py):
    • modify VOC_NAMES (or COCO_NAMES) to your class names
    • modify VOC_MEAN, VOC_STD (or COCO_NAMES, COCO_STD) to your dataset mean and std
    • modify self.num_classes to your num of classes
    • modify self.valid_ids to np.arange(1, num_classes+1, dtype=np.int32)
    • modify self.data_dir to your dataset location

If your dataset can not be converted to pascal or coco format, you will need to write your own dataset class.

ashley-mv commented 4 years ago

Thank you.

GerardWalsh commented 3 years ago

How can we use a pretrained model for training on our own dataset?