DeepFashion icon indicating copy to clipboard operation
DeepFashion copied to clipboard

Unable to train

Open punanand opened this issue 6 years ago • 10 comments

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

punanand avatar May 29 '18 08:05 punanand

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.

abhishekrana avatar May 29 '18 09:05 abhishekrana

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 avatar May 29 '18 09:05 punanand

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.

punanand avatar May 29 '18 13:05 punanand

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)

abhishekrana avatar May 29 '18 13:05 abhishekrana

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.

punanand avatar May 29 '18 14:05 punanand

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).

abhishekrana avatar May 29 '18 14:05 abhishekrana

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

punanand avatar May 29 '18 14:05 punanand

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.

punanand avatar May 30 '18 12:05 punanand

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).

abhishekrana avatar May 30 '18 13:05 abhishekrana

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

madiha2180 avatar May 05 '19 13:05 madiha2180