This repository basically used how to use the latest state of the art detection model for fine tuning ,
facebook have released but not showed how to fine tune it for custom dataset and training for the custom dataset
this is humble try to make it avialble for the training for custom dataset
kindly refer to this link DETR REPO this is the original repo for detr and after that i have made several changes to it and uploaded heres for requirement also look at the file detr/requirement.txt
there'll be some step and i'll guide each and every step
First of all we need to install all the dependencies for required library and packages look at the file detr/requirement.txt and install all the requirements and also git is need to be installed
clone this repository
git clone https://github.com/pratikkorat26/DETR_FineTuning
- This model expect the data in the coco json format and specific directory structure as shown below picture
- and name of the json files should be
-
for training data file name should be
- instances_train2017.josn
-
for validation data file name should be
- instances_val2017.josn
-
directory structure
path to cloned repo/ - data/ -annotations/ json files -train2017/ images for training -val2017/ images for validation
here the data folder is the same as present in this repo and for your data replace the your custom data and rename the files as i have mentioned above
i could have changed but i prefer to keep as it is ( name of the files)
-
for converting annotations from xml to json
- i have used the roboflow's scripts and some additional steps
-
Now we are all set for the training
- open the conda prompt and lead the directory
example for the given data in the repository
- run this command
- python main.py --num_classes 2 --coco_path "data" --batch_size 1 --num_queries 20 --output_die "path to where to save"
- num_queries should always be greater than maximum number of bounding boxes in trainset
and more flags are there you can check it make it more compatible model
and everything get well you'll as shown in below picture
and if changes are needed to be done , all changes are accepted and make a pull request and if i missing something let me know and for contacting mail me
mail address ==> [email protected]