-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
demo #1
Comments
Thanks. You only need to comment out all the parts of E2CNN. I updated GGHL.py, you can try it with the new version. In addition, the E2CNN library (https://github.com/csuhan/e2cnn) is used by ReDet's backbone. Because I want to try other backbones for recently, I added it. |
Thank you @Shank2358 for your quick response. |
Of course. The weights for the SKU datase has already been available. You can download it from Baidu Disk(password: c3jv) or Google Drive. The weights for the SSDD+ dataset will also be available soon. Thank you. |
@Shank2358 I really want to train my own dataset. The VOC format is not a problem but can you tell me the way you define the rotating angle ? |
Congratulations! For oriented bounding boxes, maybe you can use cv2.polylines(img, [points]) to draw them. The results in our paper are drawn like this. (I see that the result of your visualization is horizontal bounding boxes, maybe you can try this) The format of the training dataset is like this: We use the opencv definition of the angle, that is, the range of the angle is [0,-90), and a more specific explanation is as follows You can use the cv2.minAreaRect(Points) function to calculate the angle. [2021-11-15-16:23] I have updated the description of the data set format in readme.md. |
Hello @Shank2358 |
Hi. I have added a script for generating datasets in ./datasets_tools/DOTA2Train.py, maybe you can try it. |
@Shank2358 I see, I will try it. |
@Shank2358 |
This angle transformation in paper has been done by the opencv function. so the output is (-pi/2,0] directly. |
@Shank2358 |
Hi. I guess the following potential problems may lead to Nan.
As the only information available to me is this screenshot, I can only infer from experience that Nan may be caused by the above reasons. I guess it is a higher probability of data conversion and pre-trained weight. Try them first. If you still have problems, please leave me a message or e-mail. I will try my best to help you solve this problem. Thank you. |
@Shank2358 |
import matplotlib.pyplot as plt
img = np.uint8(np.transpose(img, (1, 2, 0)) * 255)
plt.figure("img")
plt.imshow(img)
mask_s = np.max(label_sbbox[:, :, 16:], -1, keepdims=True)
plt.figure("mask_s")
plt.imshow(mask_s, cmap='jet')
mask_m = np.max(label_mbbox[:, :, 16:], -1, keepdims=True)
plt.figure("mask_m")
plt.imshow(mask_m, cmap='jet')
mask_l = np.max(label_lbbox[:, :, 16:], -1, keepdims=True)
plt.figure("mask_l")
plt.imshow(mask_l, cmap='jet')
plt.show() By the way, datasets_ obb.py can be run independently (I wrote the main function). You can run it when checking data and visualization.
|
@Shank2358 |
It seems OK. |
@Shank2358 |
The loss_cls is not add to the total loss, we use the loss_pos and loss_neg instead. Maybe you can try to add this for stable training in the early stage. I have modified the loss_jol.py, please update it. |
@Shank2358 I have double checked the data, the annotation was correct, but the model doesnt converge. the mAP is always zero :O |
|
I cloned this code and trained GGHL for 30 epochs on the HRSC2016 dataset. The model can converge. I have uploaded the training log to the log folder. The following is a visual Gaussian heatmap. I also tested the mAP and visual detection results and showed that everything is normal. Although the mAP is not very high because the training rounds are not complete,it shows that the code can work. I will continue to complete the training and update the final results. It may take some time. Therefore, I think there seems to be no problem with the code. It is more likely to be the problem of label conversion (see the previous reply for details). I will continue to check the code and help you solve this problem. Thank you. |
@Shank2358 |
Of course. It's my pleasure. My email is zhanchao.h@outlook.com |
|
@Shank2358 |
|
@Shank2358 look great :O !!!!! |
Cool!Thanks for sharing. |
can you change another email address? Thanks |
@Shank2358 |
How many training samples do you have?
Can you show me the loss, please? |
@Shank2358 |
@Shank2358 |
It seems to be a classification problem, cls_loss is very high, because the scores = confidence * class_scores. If there are results in this way, then it is a classification problem. Then continue to troubleshoot the bug. Maybe there is a problem with the loss of the category, or maybe the id of the category is not correct? There are two bugs in the loss function. I changed it the day before yesterday. Have you updated it? |
In addition, 500 epochs seem to be too much, and the model may be over-fitting. |
@Shank2358 |
Oh i didnt update it :((. I will retrain to see. |
I'm sorry, this bug appeared in the version a few days ago, I forgot to remind you.
There are some updates to the details of the code. You'd better update the three files of dataloader, agmentation, and loss. thanks. |
oh i will pull the latest code and re-train. |
1 and 2 ar OK If you want to get the bbox, it may be more appropriate at this position, they are the decoded boxes Here is the result of decoding bbox=[x1,y1,x2,y2,x3,y3,x4,y4] according to coors=[xmin,ymin,xmax,ymax] and coors_rota=[s1,s2,s3,s4] |
If there is no problem with the positioning and the results can be displayed, you can try to retrain and see. If there is still a problem with bbox positioning, you may need to continue to troubleshoot the bug first. |
@Shank2358 |
@Shank2358 |
Do loss_cls and loss_pos not decreased? Or is there only one loss that does not decrease? |
Did you run out of the result of the toy dataset yesterday? If you can get results similar to mine, it means that our code is consistent. |
@Shank2358 |
Thanks. I will try to train and give you feedback as soon as possible. |
The loss when training 12 epochs. It seems to converge. I will give you feedback after all training in a while. Then I will email you all the codes, weights and logs of my training. It seems that there are still some problems in your code. In addition, I will keep your data confidential. |
@Shank2358 I see, thank you ! |
I have trained it for 185 epochs. This is part of the result of the visualization, it seems that the object can be detected. However, it is indeed difficult to detect such long objects, especially when returning to s1-s4. I increased the loss of this part by 3 times. Like most rotating object detection methods, GGHL does not perform as well as expected in the detection of such extremely long objects. For such objects, maybe you can try the PIOU algorithm. At least the experiment at this stage proves that GGHL can work. For this type of object, I adjusted some hyperparameters. You can see the details in the code I sent you. In the label assignment process, these objects are relatively large, so they are all assigned to the mask_l layer. Therefore, it is not necessary to use a 3-layer FPN structure if there are only such objects, only one layer is OK. Maybe you can change the model structure. Regarding the improvement and adjustment of the model, we can continue to discuss if you are interested. Next, maybe you need to see where there are errors in your code based on the code I sent you, and then adjust the parameters and try again. The dataset is relatively small, I also suggest that you can try a smaller model, such as resnet18. Then there are many excellent rotating object detection methods that are also worth trying. Adjust and select the appropriate model according to your task needs. Thanks. |
@Shank2358 |
You're welcome~ |
Thank you @Shank2358 for sharing a great work.
Iam trying to visualize the detection with your work.
But when I normally ran the test.py file, it popped up an error about e2cnn. So can you show me the reference of e2cnn.
Thank in advance.
The text was updated successfully, but these errors were encountered: