Giter Club home page Giter Club logo

flower-classifier-webapp's Introduction

FLOWER-CLASSIFIER-WEBAPP

This is an neural network webapp visualizing the training of the network and testing accuracy of 98.6% accuracy. The neural network uses pretrained resnet152 and then trained to classify images of flowers. It is built using Pytorch framework using Python as primary language. The webapp is built using flask.

Dataset used :

102 Category Flower Dataset

http://www.robots.ox.ac.uk/~vgg/data/flowers/102/index.html
Maria-Elena Nilsback and Andrew Zisserman

Neural Network used :

Resnet152
Network Layers in Pytorch

  • You can dowload ResNet152 here
  • You can download overall modified model here

resnet152

Refresher on Neural Network :

Gradient Descent
Backpropogation

Flow :

Complete flow :

model

Run on windows -

Make sure you have installed Python , Pytorch and flask.

  • First download all the folders and files
    git clone https://github.com/souravs17031999/FLOWER-CLASSIFIER-WEBAPP.git
  • Download pretrained weights and keep it in the same Project directory Download here.
  • Then open the command prompt (or powershell) and change the directory to the path where all the files are located.
    cd FLOWER-CLASSIFIER-WEBAPP
  • Now run the following commands -

set FLASK_APP=flower.py

flask run

This will firstly download the models and then start the local web server.

now go to the local server something like this - http://127.0.0.1:5000/ and see the result and explore.

@creator - sourav kumar

flower-classifier-webapp's People

Contributors

dependabot[bot] avatar souravs17031999 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

flower-classifier-webapp's Issues

Error with loading the saved model

I installed all the packages in the requirements.txt
However, when I run the following commands after reaching the directory with the files and folders:

set FLASK_APP=flower.py python -m flask run

I get the following error:

`(base) C:\Users\kwinb\Downloads\FLOWER-CLASSIFIER-WEBAPP-master>python -mflask run
Serving Flask app "flower.py"

  • Environment: production
    WARNING: Do not use the development server in a production environment.
    Use a production WSGI server instead.
  • Debug mode: off
    Traceback (most recent call last):
    File "C:\Users\kwinb\Anaconda3\lib\runpy.py", line 193, in _run_module_as_main
    "main", mod_spec)
    File "C:\Users\kwinb\Anaconda3\lib\runpy.py", line 85, in run_code
    exec(code, run_globals)
    File "C:\Users\kwinb\Anaconda3\lib\site-packages\flask_main
    .py", line 14, in
    main(as_module=True)
    File "C:\Users\kwinb\Anaconda3\lib\site-packages\flask\cli.py", line 894, in main
    cli.main(args=args, prog_name=name)
    File "C:\Users\kwinb\Anaconda3\lib\site-packages\flask\cli.py", line 557, in main
    return super(FlaskGroup, self).main(*args, **kwargs)
    File "C:\Users\kwinb\Anaconda3\lib\site-packages\click\core.py", line 717, in main
    rv = self.invoke(ctx)
    File "C:\Users\kwinb\Anaconda3\lib\site-packages\click\core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
    File "C:\Users\kwinb\Anaconda3\lib\site-packages\click\core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
    File "C:\Users\kwinb\Anaconda3\lib\site-packages\click\core.py", line 555, in invoke
    return callback(*args, **kwargs)
    File "C:\Users\kwinb\Anaconda3\lib\site-packages\click\decorators.py", line 64, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
    File "C:\Users\kwinb\Anaconda3\lib\site-packages\click\core.py", line 555, in invoke
    return callback(*args, **kwargs)
    File "C:\Users\kwinb\Anaconda3\lib\site-packages\flask\cli.py", line 767, in run_command
    app = DispatchingApp(info.load_app, use_eager_loading=eager_loading)
    File "C:\Users\kwinb\Anaconda3\lib\site-packages\flask\cli.py", line 293, in init
    self._load_unlocked()
    File "C:\Users\kwinb\Anaconda3\lib\site-packages\flask\cli.py", line 317, in _load_unlocked
    self._app = rv = self.loader()
    File "C:\Users\kwinb\Anaconda3\lib\site-packages\flask\cli.py", line 372, in load_app
    app = locate_app(self, import_name, name)
    File "C:\Users\kwinb\Anaconda3\lib\site-packages\flask\cli.py", line 235, in locate_app
    import(module_name)
    File "C:\Users\kwinb\Downloads\FLOWER-CLASSIFIER-WEBAPP-master\flower.py", line 4, in
    from inference import get_flower_name
    File "C:\Users\kwinb\Downloads\FLOWER-CLASSIFIER-WEBAPP-master\inference.py", line 11, in
    model = get_model()
    File "C:\Users\kwinb\Downloads\FLOWER-CLASSIFIER-WEBAPP-master\commons.py", line 13, in get_model
    model.load_state_dict(torch.load(checkpoint_path,map_location='cpu'),strict=False)
    File "C:\Users\kwinb\Anaconda3\lib\site-packages\torch\serialization.py", line 367, in load
    return _load(f, map_location, pickle_module)
    File "C:\Users\kwinb\Anaconda3\lib\site-packages\torch\serialization.py", line 528, in _load
    magic_number = pickle_module.load(f)
    _pickle.UnpicklingError: invalid load key, 'v'.`

How do I solve this?

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.