Skip to content
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

Unable to train #5

Open
punanand opened this issue May 29, 2018 · 10 comments
Open

Unable to train #5

punanand opened this issue May 29, 2018 · 10 comments

Comments

@punanand
Copy link

Sir,
I read your repo and went through the code, found it really interesting and looking forward to use it in my current project. But when I downloaded the dataset ,I don't have enough specs on my system to meet the requirements. I request you to please share the trained model file since I can't afford that king of system at this age.
Please help me with this.
Thank you a lot sir,
Cheers

@abhishekrana
Copy link
Owner

Hi,

I trained the model for 19 classes (as the entire dataset is quite big) a long time ago.

Here are the weights which I could find:
https://drive.google.com/open?id=12DFSzosFAw7SnuwJWnYboFUBunJMrM64

Also, these may not be the best weights. So you can tune the hyperparameters and further train the model to get better results.

@punanand
Copy link
Author

Thanks a lot sir for your help.
I am currently running the code and I will let you know if I face any other problem.
Thanks a lot.

@punanand
Copy link
Author

Hi sir,
I ran the code, it is running fine but I have a query that when I run the predict.py script then it boxes the areas for the same apparel rather boxing the entire apparel in a unique box. Since my next task in the project is to crop the box and retrieve the kNN for that cropped image.
Can't I have a unique box indicating the apparel ?
Thanks.

@abhishekrana
Copy link
Owner

The current code makes many predictions for a single image.
Each prediction consists of the predicted class(i.e. apparel having the highest probability), probability of that class, it's bounding box location in the image and IoU prediction(i.e. confidence in the predicted class).
You can sort these predictions based on the probability OR the IoU(intersection over union) and use the highest one to get a unique box.
(But I think the current predictions may not be the very good because the trained weights provided above are not the best ones and more training and hyper-parameter tuning is required to get better results)

You will find the following variables useful:
predict.py : Line 140
display_bbox(orig_image_path_name, bboxes, prediction_class_name, prediction_class_prob, prediction_iou, images_name_list)

@punanand
Copy link
Author

Thanks a lot for the help.
I found the IoU method pretty interesting and looking forward to implement that but facing planning problem. If I predict the apparel by using the IoU technique, still the issue raises in boxing the complete apparel, since your trained data model boxes small regions instead of the complete ones.
So for getting the complete box I need to get another training data and get it trained ?
Also sir I need to ask if I can get the trained file of all the classes instead of the 19 classes that was provided by you earlier?
Thank you.

@abhishekrana
Copy link
Owner

abhishekrana commented May 29, 2018

In the RESULTS section of the repo, you can see that some bounding boxes enclose the entire jean ("complete ones") while some only a part of it("small regions"). The required bounding box can be filtered out using probability or IoU values (The small regions can be removed by discarding predictions with bounding box area < threshold OR by some other techniques).

I guess the way to predict only the "complete ones" is to retrain the model with hyper-parameter tuning in order to get better weights OR to modify the model itself in the code(such as adding more layers) and train it again.

I never trained on the entire dataset because:

  1. It was very large.
  2. There was a lot of class imbalance.

Hence I selected only 19 classes having similar frequency (Although this subset of dataset is still biased towards some classes due to class imbalance).

@punanand
Copy link
Author

Alright sir,
Thanks a lot.
Still if I face any issue i will let you know.

@punanand
Copy link
Author

Hi Sir,
I was working on the further parts of my project using your project. I came through a problem. The code does not even give the correct boxing of the apparels whose class are being trained.
Your concept was of great help, I need another help resolving these kind of issues sir.
Like for example,
screenshot from 2018-05-30 18-23-00
Thanks a lot sir.

@abhishekrana
Copy link
Owner

abhishekrana commented May 30, 2018

The model tries to detect apparel type only for the Region of Interests (ROI) proposed by selective search algo.
During training, the dataset had only one person per image and hence the selective search prediction was decent enough. But in your example above, there are multiple people. So the Region of Interests (ROI) proposed by selective search might not be good (my guess). Hence the model is having a hard time predicting correct apparel type.
Also, the selective search itself has some hyper-parameters which might need tuning.
To get very good results, maybe you can take a look into Faster RCNN (which works on similar concept).

@madiha2180
Copy link

Hi Sir,
I am facing a problem while running the train.py file ,whenever i run it

"IndexError: arrays used as indices must be of integer (or boolean) type"
comes on
"class_weight_val = class_weight.compute_class_weight('balanced', np.unique(train_labels_class), train_labels_class)"
line

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants