-
Notifications
You must be signed in to change notification settings - Fork 77
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
Custom Image Preprocessing #126
Comments
Hi. The best place to make these changes would be in the |
okay thank you! I have another question. If I want to achieve high accuracy and fps for traffic sign recognition, which pretrained layer is the best? Based on my observation, resnet50 achieves high accuracy and the fps is not as expected. |
You can try Faster RCNN MobileNet V3 model. |
okay thanks! by any chance, do you know what's wrong with this? i checked online, they mentioned that its sth related to the gradient/lr and optimizer. 842 Epoch: [6] [2700/7446] eta: 0:08:01 lr: 0.001000 loss: 0.2247 (0.2497) loss_classifier: 0.0683 (0.0744) loss_box_reg: 0.1534 (0.1739) loss_objectness: 0.0001 (0.0002) loss_rpn_box_reg: 0.0011 (0.0013) time: 0.0961 data: 0.0086 max mem: 1620 |
Try lowering the initial learning rate to 0.00001 |
i tried with new lr, it shows the same error.. 845 Epoch: [6] [2800/7446] eta: 0:07:49 lr: 0.000010 loss: 0.3495 (0.4442) loss_classifier: 0.1362 (0.2124) loss_box_reg: 0.2011 (0.2273) loss_objectness: 0.0000 (0.0003) loss_rpn_box_reg: 0.0039 (0.0043) time: 0.0961 data: 0.0044 max mem: 1622 |
Hi, this generally does not happen. This is one of the first times I have seen this issue. Were you able to solve the issue? |
Unfortunately no, but this error only happens with mobilenet. I tried w other layers with the same parameters, they all working fine. |
Ok. May I know your PyTorch version. I will try to debug deeper this weekend. Also, if possible is there a link to your dataset that I can use for debugging? |
my pytorch version is '2.1.0' and torchvision is 0.16.0. the dataset used is the GTSRB. I create the dataset by using the create xml u used your previous example. |
hi, may I ask what kinds of hardware u used to run the inference? I have tried NVIDIA Jetson Xavier to run the onnx inference code, the FPS only reaches max of 7. The pretrained layer I used is mini darkent with nano head. Also, I used cv2.VideoCapture() for live detection, is that the factor affecting the fps? |
I compute the FPS on the forward pass only. So, the cv2 functions won't affect it. Faster RCNN, although accurate, struggles a bit to give high FPS on edge devices. I am trying to optimize the pipeline even more. |
alright thank you! Can I ask how to improve the accuracy of the training? Currently I tested out on GTSDB with mobilenet but the accuracy only 23 after 250 epochs... |
I think you can use the Faster RCNN ResNet50 FPN V2 model. It works very well for small objects. |
hi i tried with resnet fpn v2, the best mAP only reaches 51% @0.5:0.95 & 65% @0.5. May I know what else I can do to increase the accuracy? So far I tried with applying the image preprocessing techniques, but the outcome is not that significant. |
May I know the dataset. |
gtsdb |
Have you tried with the default code in the repository without additional changes to the image processing techniques? If so, can you please let me know the result? Also, for GTSDB, training with higher resolution images will help a lot. |
yes, I tried with the default code without any additional change, the best result is 51% @0.5:0.95 & 65% @0.5. My aim is to reach accuracy of 90%+, is it possible? Does it mean that I have to modify the resolution of the GTSDB using online tools? I just downloaded from website by default. |
You use the |
besides --imgsz, is there other factor affecting the accuracy? >< |
There are a lot actually. I will recommend going through all the command line arguments in the |
Hi Sovit. I would like to implement F1-score and recall as the metrics. May I ask where I can make the modification? |
I think creating a separate |
does it mean that the |
Oh, if you wish to add that to the evaluation part after training only, then you can directly modify the |
I tried to add torchmetrics
May I know how to solve this issue? |
It is basically saying that the list and tensor data types do not have a |
What will be the best way to include the metrics? I'm using the same target and preds u have been using.... |
I need to take a look how to structure the additional changes. |
Hi Sovit, is it possible to train and evaluate a model with multiple datasets? I would like to test their consistency. |
Hi. Can you please explain what you mean by multiple datasets? |
for example like GTSRB CTSRD, so that it can detect more types of traffic signs |
So, if you can keep the images and labels in the same directories and adjust the YAML file to have the correct classes, then it is certainly possible. |
Hello! @sovit-123 |
@Najamulhassan3383 |
Hi, I need help in implementing my own image preprocessing techniques before training and inference. For training, I only found the "get_train_aug" consists of Albumentation, and it directly passes to "create_train_dataset". However, my techniques will be in cv2 format.
Please give me advice on where I can modify the codes. TQ!
My sample techniques will be like this:
img = cv2.imread(os.path.join(img_dir, image))
lab = cv2.cvtColor(img, cv2.COLOR_BGR2LAB)
_channel, a, b = cv2.split(lab)
The text was updated successfully, but these errors were encountered: