-
Notifications
You must be signed in to change notification settings - Fork 783
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
Quick Questions #9
Comments
I'm NOT using Multiscale Training. Yes, I have the pre-trained weights on VOC data. It's here #6. I think that 300 images are good enough if you use the pre-trained weights and extensive data augmentation. |
@experiencor ...Thanks For your Suggestion ... Is there a Difference in Weights Downloaded as tiny-yolo-voc.weights and the link you provided... and also apart from the Data augmentation you wrote in your code ..What Other data augmentation do u suggest... |
They are identical. For best result, you may look at object detection code by Google for more advanced data augmentation https://github.com/tensorflow/models/blob/master/object_detection/core/preprocessor.py. |
Thanks for your reply... Pls Let me know your Views ... |
Yes, the anchor boxes are implemented in YOLOv2 and my version too. A set of 5 anchor boxes is used. |
@cosmicad great job! Why do you want to increase the threshold in the first place? The result seems good enough already. Increasing the data always helps, but it takes time. Shorter way is to artificially augment existing images (try to rotate the images, change brightness, add random dropouts, ... like in this https://github.com/aleju/imgaug). In addition, I'm in the process of coding up a new loss function, which may improve the result. Stay tuned. |
I see that your case is highly unbalanced. The best way I know of to deal with this issue to penalize the classification loss differently for different classes. You can try to change the following 2 lines that define the weights of the classification errors for that purpose: weight_prob = tf.concat(CLASS * [true_box_conf], 4)
weight_prob = SCALE_PROB * weight_prob I'm very curious with the result. Please update me if possible. |
Definitely sir... I would request you to elaborate on the same...with a small example ...I would definitely catch up and come up with a result... |
You may want to check the new code. The weights of the classes are specified in class_mask = y_true[..., 4] * tf.gather(CLASS_WEIGHTS, true_box_class) * CLASS_SCALE Please note that I have made substantial changes to the loss function to closely follow the original implementation. The architecture has also been changed from the tiny version (9 layers) to the full version (23 layers). The new architecture is much more accurate but will be a bit lower than the old one. |
changing the no of labels from 80 to 1 or 2 or 3 Gives the below error :
|
It's fixed. The reason is that I need to vary the number of filters of the last layer according to the number of labels. |
I tried your new code...I tried training only one class for detection ... Do not Why the Detection was not Good...May be I am Doing something Wrong with the code... Below is the Link of Jupyter notebook for your reference :- Pls review it...It contains all executions with outputs... I am Thanksful to you for your Efforts and Time you spend in resolving my query ... Pls let me know your views.. |
The issue is that the non-predictor anchors tend to be activated at the same time with the predictor anchor. I have the same issue with training with any one class problem. So I think you are doing it right. However, I don't have this issue with training with many classes like in the COCO dataset (80 classes). Seems to be a complex issue, still debugging ... |
I got the one class case to work. Just to tweak the parameters. The tweaks that I used to get it working are:
From this: train_batch = BatchGenerator(train_img, generator_config, jitter=False) To this: train_batch = BatchGenerator(train_img, generator_config)
From: steps_per_epoch = train_batch.get_dateset_size() To: steps_per_epoch = train_batch.get_dateset_size() * 5 The last 2 steps are essential to deal with the small size of your dataset. This is the result: a Raccoon Detector (https://www.youtube.com/watch?v=aibuvj2-zxA) trained on 160 images using the dataset from https://github.com/datitran/raccoon_dataset. This the reference video by the author of the dataset using Google API if you want to know how well the network does (https://www.youtube.com/watch?v=W0sRoho8COI). So you may try a combination of these tweaks to see if it work. Let me know the results if possible. |
tried Using your technique but No Luck .....I do not know what incorrect am I doing ... I request u to help me out with my dataset once...Pls ... dataset Link >>> https://github.com/cosmicad/dataset.git I am Thanksful to you for your Efforts and Time you spend in resolving my query ... Regards |
Ok, sure. I take a look. |
This is what I get https://github.com/experiencor/basic-yolo-keras/blob/master/examples/Blood%20Cell%20Detection.ipynb. This result is okay, right? BTW, is it fine if I put the result of your application to the readme of this repo? |
@akshaylamba Congratulate! The result looks stunning to me. You can use this script to compute mean precision and recall https://github.com/rbgirshick/py-faster-rcnn/blob/master/lib/datasets/voc_eval.py. It's a very dirty script. Otherwise, you can use this one https://github.com/cocodataset/cocoapi. You have to convert from the annotations from VOC to COCO to use the latter one. |
Hello @experiencor ... I Could Not respond as was Bad on Health... Can You guide me... |
@akshaylamba I'm still finding time to clean my own evaluation code. Will update the code asap. |
@akshaylamba You may try the code suggested in #27. |
@experiencor ... I Have Been Trying to Deploy the YOLO Model On To Web and Create an API for Inference Purpose... Can You Pls Guide me on this... |
@akshaylamba I'm not an expert in deployment but I would use some kind of TensorFLow Serving for this. Alternatively, you may also use Amazon SageMaker. And if you want to run the things entirely in browsers, you may check my other repo https://github.com/experiencor/deeplearnjs. |
Things to note to reproduce my result:
Cheers. |
Thank you so much!!!! It is working now! |
I was able to reproduce the raccoon results with Full Yolo, but no luck with Tiny Yolo...
I tried using your provided tiny_yolo_raccoon.h5 for prediction and it was great, what should I do get your tiny yolo results? |
It's very tricky to get Tiny Yolo to work given its much less expressive power. You need to play with the 4 scale. Increasing |
Okay, I will try that. |
@akshaylamba : Where have you found the multiclass annotations for this data set? Could you share the code you ran to obtain the prediction for these 2 images? |
Hello
Are you using Multiscale Training of Data..also You have Pretrained Weights on VOC Data ...Below is the Image of Blood Smear :-
I Want to Detect The Purple Color and Red Color Cells...I have Done the Annotations ...
I Only have 300 Images With Me with 15-20 Annotation in an Image...What do u Recommand ...
The text was updated successfully, but these errors were encountered: