ReDet icon indicating copy to clipboard operation
ReDet copied to clipboard

Training on a new dataset

Open Sairam13001 opened this issue 2 years ago • 6 comments

Hai sir,

I want to train ReDet on VisDrone dataset. For VisDrone dataset, the ground truth object segmentation details are not provided in annotation files.

The annotation format for VisDrone is like this:

"<bbox_left>,<bbox_top>,<bbox_width>,<bbox_height>,,<object_category>,,"
which is different from HRSC and DOTA datasets that have OBB annotations.

Can I train ReDet on VisDrone only using the BBOX information??

Sairam13001 avatar May 15 '22 05:05 Sairam13001

Yes. Our models use the standard COCO style annotation. You can transform your data to COCO's json annotation.

csuhan avatar May 15 '22 11:05 csuhan

Thank you for the reply. yes, I converted VisDrone data to COCO's json format. But the problem is ground truth segmentation details are not given for VisDrone dataset.

Using the given [x,y,w,h] format, I added segmentation as [x,y,x,y+h,x+w,y+h,x+w,y] and trained the model. The training code ran without any issue. The losses also reduced with the epochs.

I ran test.py and got the prediction results.

I modified DOTA_devkit/dota15_evaluation_task2.py code to work for the VisDrone data.

But the AP for all the classes turned out to be 0. I tried to understand why this happened but I couldn't figure it out.

Any idea why it could have happened?

Thank you.

Sairam13001 avatar May 15 '22 11:05 Sairam13001

Since you have converted visDrone to COCO's style, I suggest to evaluate your model with COCOEval directly. But you need to convert the RBOX results to BBOX.

Another way, you can convert visDrone's annotations to DOTA format:

x1, y1, x2, y2, x3, y3, x4, y4

Then you can convert them to COCO style by DOTA_devkit/DOTA2COCO.py.

So we can train, test and evaluate the model with the converted dataset.

csuhan avatar May 16 '22 08:05 csuhan

Okay, thank you very much for the reply. I will try your suggestions and let you know if it worked for me.

Sairam13001 avatar May 20 '22 12:05 Sairam13001

Sir, one last question!

I converted VisDrone annotations to DOTA format (x1,y1,x2,y2,x3,y3,x4,y4,class_name,difficult) and then used DOTA_devkit/DOTA2COCO.py to generate COCO format json files.

One point to note is that, VisDrone has HBBs. The given annotations are of type x,y,w,h. And using them I created (x1 = x, y1 = y, x2 = x+w, y2 = y, x3 = x+w, y3 = y+h, x4 = x, y4 = y+h). Example: 708 471 782 471 782 504 708 504 car 0

Training ran well. The loss during training constantly went down. Then I used tools/test.py to generate predictions and tools/parse_results.py to parse the results.

I noticed that the generated results are not HBBs. One of the results: 0000194_00625_d_0000122.jpg 0.336 702.937 337.499 702.924 369.846 655.261 369.827 655.275 337.480 0.336

Is this normal? Shouldn't the generated results be also HBBs?

Sairam13001 avatar May 21 '22 03:05 Sairam13001

It would be normal. Check your work_dirs/your_config_name and you can see a folder Transed_Task2_results_nms after parse_results.py. The folder contains the HBB results converted from OBB.

csuhan avatar May 21 '22 17:05 csuhan