Code Monkey home page Code Monkey logo

apparel-styles's Introduction

Apparel Classification App

Predict multiple attributes for a given apparel. This app was developed during Insight AI Fellowship in March'2017. The app was developed using Python and uses PyTorch deep learning framework and Tordado web server.

Slides

Setup Environment on Local Machine

Installation

git clone https://github.com/sampathweb/apparel-styles

cd <repo>  # cd apparel-styles

# Install Packages
python env/create_env.py
source activate env/venv  # Windows users: activate env/venv
python env/install_packages.py

# Build the Model
python ml_src/build_models.py

# Run the App
python run_server.py

Test App

Open Browser: http://localhost:9000

Dataset:

H. Chen, A. Gallagher, B. Girod, "Describing Clothing by Semantic Attributes", European Conference on Computer Vision (ECCV), 2012.

The End.

=======

apparel-styles's People

Contributors

sampathweb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

apparel-styles's Issues

Negative Loss

Hey.
I'm trying to follow the steps in clothing-attributes-moduler.ipynb

I initially was using torch version 1.4 and ran into some index errors[1 line in classifiers.py] but fixed it and the model resulted in Loss: -0.0180 Acc: 0.5318
after 18 epochs.

torch also raised some user warnings like
UserWarning: The use of the transforms.Scale transform is deprecated, please use transforms.Resize instead
and
UserWarning: Implicit dimension choice for softmax has been deprecated. Change the call to include dim=X as an argument. return F.softmax(self.model(x))

So I decided to test on an older version of torch [torch=0.4.1 and torchvision=0.2.2]
but still the same issue persists
I got the same warnings
and the model resulted in -0.0180 Acc: 0

What do you think could be the source of the issue? The negative loss value hints towards something to do with the loss function. So should I specify a dim value to the softmax layer?

Thanks :)

Acc. always 0%

when I try build model I get always acc: 0.000 best_acc:0.000

num_epochs=50,
is_train=True,
use_gpu=True

Introduce Stratified Kcrossfold validation.

I am new to torch. Can you tell me how to introduce k cross fold validation with the training part in train_attribute_model(). I think some steps will be added after the data is loaded ie, after AttributeDataset class object is returned.

Steps to get good results

The documentation is poor here. Here are the steps to get a good result:

  1. First download the ClothingAttributeDatasetand put it in the data folder.

  2. In the ml_src folder, run the data-prep.ipynb. Don't spilt train test by hand.

  3. In the ml_src/weights folder, create a folder called vgg16-fcn-266-2

  4. Run python ml_src/build_models.py from outside the ml_src folder.

http://localhost:9000 & CondaEnvironmentNotFoundError:

hey! I feel confused about this address... http://localhost:9000
I can not open it, could you please tell me how can I open it successfully?
Even worse, when I try to Setup Environment on Local Machine
It always reminds me that CondaEnvironmentNotFoundError: Could not find environment: D:\Anaconda\envs\env/venv,but I have activated 'env/venv'....
Thank u!!

RuntimeError: Found 0 images in subfolders of: data/ClothingAttributeDataset/train/

Hy! I'm trying to learn machine learning, and from this how to extract from a photo different attributes. I looked through your project, trying to figure out how you do it, but when i'm running it i got this message error RuntimeError: Found 0 images in subfolders of: data/ClothingAttributeDataset/train/, even if i created the folder data/ClothingAttributeDataset/train/, and put images into. can you please tell me, what i'm doing wrong, or what i missed? Thank you :).

No such file or directory on finishing training

I've managed to get the network to train on my machine but once it finishes training and tries to save the results I get the error:-

Traceback (most recent call last):
  File "/ml_src/build_models.py", line 37, in <module>
    use_gpu=use_gpu)
  File "/ml_src/classifiers.py", line 466, in create_attributes_model
    save_model(model, weights_path)
  File "/ml_src/classifiers.py", line 262, in save_model
    torch.save(model.state_dict(), weights_path)
  File "/opt/conda/lib/python3.6/site-packages/torch/serialization.py", line 209, in save
    return _with_file_like(f, "wb", lambda f: _save(obj, f, pickle_module, pickle_protocol))
  File "/opt/conda/lib/python3.6/site-packages/torch/serialization.py", line 132, in _with_file_like
    f = open(f, mode)
FileNotFoundError: [Errno 2] No such file or directory: '/ml_src/weights/vgg16-fcn-266-2/category_GT.pth'

Is the folder found in the pytorch system files? Do I need to download these weights from somewhere else?
Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.