Data Science & Machine Learning Project - Part 6 Flask Server | Image Classification

Поделиться
HTML-код
  • Опубликовано: 27 авг 2024
  • Python flask is a light weight web server. In this video, we will write a flask server that will use the trained model and perform image classification. UI will talk to this backend server and perform image classification task for our sports person identification project. At the end of this video you will have fully functioning python flask server or backend ready that UI can talk to. In next video we will write UI or front end website for our project.
    Code: github.com/cod...
    Special thanks to,
    Debjyoti Paul (Amazon Data Scientist): For help with entire project
    Do you want to learn technology from me? Check codebasics.io/ for my affordable video courses.
    Website: codebasics.io/
    Facebook: / codebasicshub
    Twitter: / codebasicshub

Комментарии • 108

  • @codebasics
    @codebasics  2 года назад

    Check out our premium machine learning course with 2 Industry projects: codebasics.io/courses/machine-learning-for-data-science-beginners-to-advanced

    • @abhishekpatil3524
      @abhishekpatil3524 11 месяцев назад

      i am getting error :No module named 'wavelet

  • @danielahinojosasada3158
    @danielahinojosasada3158 2 года назад +4

    Your videos are an incredible step toward equal access of education. This is social justice in action. I deeply appreciate your videos and want to thank you from the bottom of my heart. I have not commented often, but I have watched probably half of all of your videos and it has certainly been life changing. I intend to introduce this subject matter inside the classroom I teach.

  • @srinath193
    @srinath193 3 года назад +7

    Sir, so much inspired after reading the article on you (in TimeOfIndia) on how you were and how you are now contributing to this Field. Kudos to your spirit...Much love!

  • @codebasics
    @codebasics  4 года назад +1

    Next Video: ruclips.net/video/Gs9t6b5wpTg/видео.html
    Data Science Project | Sports Celebrity Image Classification: ruclips.net/video/qWXXHjV3JHI/видео.html
    Machine Learning & Data Science Project | Real Estate Price Prediction Project: ruclips.net/video/rdfbcdP75KI/видео.html
    Learn data science for beginners (How to learn data science for free)?: ruclips.net/video/Vn_mmOuQkSA/видео.html

  • @AlonAvramson
    @AlonAvramson 3 года назад +1

    Thank you, this is very important to see how you mix and wrap everything together.

  • @mandulathrimanne8400
    @mandulathrimanne8400 7 месяцев назад

    Thank you for doing this, man! You're helping a lot of people out here!

  • @bhaskarg8438
    @bhaskarg8438 2 года назад +1

    Great !! Your explanation and make us to understand the concept is very very clear , thank you

  • @programmingwithraahim
    @programmingwithraahim 3 года назад +1

    31:45 mine detected Anushka Sharma as Maria Sharapova :-) The model is so funny.
    Thank You Sir for all your Dedication and Hardwork. Lots of love from Pakistan.

  • @naveenkalhan95
    @naveenkalhan95 4 года назад +2

    I am really enjoying it for sure.... super thank you :)) just want to keep commenting to value your knowledge sharing

  • @shashikumarn.s859
    @shashikumarn.s859 4 года назад +2

    Thanks a lot for such a good extent.. it helps a beginners too much,,. Great work keep carrying on!!!

  • @deshapriyamukherjee
    @deshapriyamukherjee 4 года назад +1

    You are really doing awesome brother. Please upload Deep Learning Tutorial series with that kind of fabulous end to end project.. God bless you.

  • @iitianvlogs9805
    @iitianvlogs9805 4 года назад +2

    You are great bro your teaching is ulitimate

  • @venkatesanr9455
    @venkatesanr9455 4 года назад +1

    You are doing a great job and I have learnt a lot from your tutorials. Keep doing the same

  • @prashanthshetkar2350
    @prashanthshetkar2350 2 года назад

    Thank you so much for end to end project. Please continue doing such projects...

  • @PRIYASHARMA-cr8ff
    @PRIYASHARMA-cr8ff Месяц назад

    Thankyou sir, for the amazing tutorial

  • @jaganinfo
    @jaganinfo 4 года назад +2

    executed code upto part 5 . But this video code looks like a *BIG PROJECT* :) .. _it will take more time .. i will do for great results_

    • @codebasics
      @codebasics  4 года назад +1

      Good luck jagan. I like your enthusiasm and passion Buddy

  • @shivanshaghor8443
    @shivanshaghor8443 4 года назад +1

    Hello Sir, Please make more end to end projects like this.

  • @mohammadnahyan1636
    @mohammadnahyan1636 9 месяцев назад

    Flawless teaching !🙏

    • @codebasics
      @codebasics  9 месяцев назад

      Thank you for the kind words!

  • @NguyenNhan-yg4cb
    @NguyenNhan-yg4cb 3 года назад

    More projects please, you are my Angel bro

  • @aatkafaryal1199
    @aatkafaryal1199 Год назад +1

    Sir when i run model its giving me blank output. Why? I TRIED WITH MANY PICTURES.

  • @Gurur_shots
    @Gurur_shots 10 месяцев назад

    Great 👍

  • @izharkhankhattak
    @izharkhankhattak 3 года назад

    Great work.

  • @zaindurani8168
    @zaindurani8168 3 года назад

    great work sir

  • @LanteLuthuli
    @LanteLuthuli 2 года назад

    Great job

  • @saichandra2768
    @saichandra2768 2 года назад +1

    Sir,While Running Util.py the code was not running as it is showing some error in pickle and unpickle and also giving warnings for pickle version..

  • @snehalkumbhalkar7243
    @snehalkumbhalkar7243 4 года назад +1

    its owesome

  • @727-senthilkumarm8
    @727-senthilkumarm8 9 месяцев назад

    Hi sir, I used SVM instead of Logistic Regression that perform well in prediction here.

  • @naveenkalhan95
    @naveenkalhan95 4 года назад +1

    i am getting this error:
    FileNotFoundError: [Errno 2] No such file or directory: './artifacts/class_dictionary.json'
    when running util.py

    • @codebasics
      @codebasics  4 года назад +1

      you need to explicitly copy that file from model directory to artifacts directory.

    • @naveenkalhan95
      @naveenkalhan95 4 года назад

      @@codebasics yup... you are right..big thank you for your reply :))

    • @elroyrebello3073
      @elroyrebello3073 3 года назад

      can u tell me how u did that i m getting same error

    • @kushagraporwal4591
      @kushagraporwal4591 2 года назад

      @@elroyrebello3073 did you find any solution??

    • @manthanrathod1046
      @manthanrathod1046 2 года назад

      @@kushagraporwal4591 simple read as a raw string. instead of './artifacts/class_dictionary.json' use r'./artifacts/class_dictionary.json'

  • @afsulrahman6826
    @afsulrahman6826 Год назад

    really helpfull

  • @anshudwivedi4293
    @anshudwivedi4293 2 года назад

    Hi Sir, I am receiving "AttributeError: 'SVC' object has no attribute '_probA'. Did you mean: 'probA_'?" this error while running the util.py. I tried checking the error but nothing worked. Request your help here.

  • @sourix01
    @sourix01 Год назад

    @21:18 please make sure that your base64 string format is valid to get the desired results :)
    valid base64 string format
    data:image/image_type;base64,iVBORw0KGgoAAAANSUhEUgAA... (base64-encoded data continues)

  • @nimishachitriv6576
    @nimishachitriv6576 Год назад

    When we print the loading artefacts done... It's giving me an empty list.
    Could someone please help me with that?

  • @trunghoang1227
    @trunghoang1227 3 года назад

    I have a problem.
    self.break_ties and self.decision_function_shape == 'ovo':
    AttributeError: 'SVC' object has no attribute 'break_ties'. I dont know why. please give me a suggestion thanks

  • @vishnumurali6524
    @vishnumurali6524 4 года назад

    Thank u sir...

  • @kollaanantraj3690
    @kollaanantraj3690 3 года назад

    Thanks a lot sirr.

  • @maryantwiwaa6988
    @maryantwiwaa6988 2 года назад

    please the function def classify_image(image_base64_data, file_path=None): is not working for me

  • @mayanktripathi4u
    @mayanktripathi4u 4 года назад

    Thanks sir for this awesome video tutorial.
    Please guide us on which programming is good out of Flask Vs Django.. i tried doing research but most of them scenario i found DJango as one of the best over Flask. Not sure if i missed any.
    Please help to understand.
    Also please have a tutorial how to make this website Productionize.

  • @preetiadhikari6979
    @preetiadhikari6979 8 месяцев назад

    c:\Users\hp\.vscode\python\image_classification\server\util.py "
    loading saved artifacts...start
    loading saved artifacts....done
    [ ] . I got this result , even i tried with different images . So how can i solve this problem??

    • @Lyricverse116
      @Lyricverse116 6 месяцев назад

      same issue bro were you able to solve that problem ?

  • @rinaayu4158
    @rinaayu4158 3 года назад

    thank you so much sir it's very helpful . Can that code use for the flutter application?

  • @rajivdubey2206
    @rajivdubey2206 3 года назад

    why my model is returning empty list???
    even i tried with cropped faces which was used for model traiining..
    please help

    • @rajivdubey2206
      @rajivdubey2206 3 года назад

      @@HarshPatel-iy5qe No bro I didn't got yet so I leaved this project and started learning opencv first, here they are just copying and pasting and not explaining the things..

    • @IgorKozarchuk
      @IgorKozarchuk Год назад

      In my case the problem was that I supplied the model with picture sharapova2 jpg where there are no eyes on the photo, therefore the model could not classify it and returned []. I retried with sharapova1 jpg and it worked - model returned [1].

    • @aatkafaryal1199
      @aatkafaryal1199 Год назад

      @@IgorKozarchuk same problem here. please tell me the solution

    • @IgorKozarchuk
      @IgorKozarchuk Год назад

      @@aatkafaryal1199 Just try with another image where 2 eyes can be clearly seen. Empty array may mean that model could not classify image.

    • @aatkafaryal1199
      @aatkafaryal1199 Год назад +1

      @@IgorKozarchukThe problem is solved now. I was using wrong harcascade feature for face. So I changed that now the model is working fine.

  • @salamina_
    @salamina_ Год назад

    Very helpful tutorials. thank you

  • @leocodeio
    @leocodeio 8 месяцев назад

    403 error! can anyone help please..

  • @Pride_Of_Ultras
    @Pride_Of_Ultras 2 года назад

    You are G R E A T!

  • @deghanandreddy7168
    @deghanandreddy7168 4 года назад

    Pls implement this project with dockers and Kubernetes @ dhawal pls

  • @harshvivek14
    @harshvivek14 4 года назад

    Please do this project using Deep Learning too.

  • @user-en4fq6nb8d
    @user-en4fq6nb8d Год назад

    ModuleNotFoundError: No module named 'sklearn.preprocessing.data'...
    I installed pip install scikit-learn...but this error is asking a specific version of sklearn and python....May I plz know that ?

    • @JOXAVLOGS
      @JOXAVLOGS Год назад

      Hello. Did you solve it?

    • @tusharchawla1440
      @tusharchawla1440 11 месяцев назад

      @@JOXAVLOGS I am also stuck in this problem. Did you solve it?

    • @nikhilshah1382
      @nikhilshah1382 Месяц назад

      @@tusharchawla1440 plz help is it solved

    • @tusharchawla1440
      @tusharchawla1440 Месяц назад

      @@nikhilshah1382 no it is not solved

  • @SunilKumar-jw1lv
    @SunilKumar-jw1lv 4 года назад

    Hi. Sir
    I am getting. this error , I was just trying to. run your code,

  • @nagisafurukawa8864
    @nagisafurukawa8864 2 года назад

    What is class dictionary?

  • @makeoutloud
    @makeoutloud 4 года назад

    Sir where you have uploaded your tensorflow series i wanted to learn from that please let me know 😭😭

    • @codebasics
      @codebasics  4 года назад +4

      I have few deep learning tutorials. Just search deep learning codebasics in RUclips. However I am going to start new deep learning series with best quality content. Stay tuned

  • @mandalapavankalyan1620
    @mandalapavankalyan1620 2 года назад

    While Running util.py in pycharm, getting errror like
    ModuleNotFoundError: No module named 'sklearn.preprocessing.data' in pickle.py file
    Can You please solve this issue

    • @satwikvarma2804
      @satwikvarma2804 2 года назад

      bro did you solve the issue

    • @bhupeshdewangan8461
      @bhupeshdewangan8461 2 года назад

      @@satwikvarma2804 same problem

    • @bhupeshdewangan8461
      @bhupeshdewangan8461 2 года назад

      are u able to solve ?

    • @bhupeshdewangan8461
      @bhupeshdewangan8461 2 года назад

      @@satwikvarma2804 are u able to solve ?

    • @faizgk7000
      @faizgk7000 2 года назад

      @@bhupeshdewangan8461 1)install python 3.6.1 and set that as your interpreter in pycharm
      2) install module called scikit-learn of version 0.20.3 (open cmd and type "pip install scikit-learn==0.20.3")

  • @SunilKumar-jw1lv
    @SunilKumar-jw1lv 4 года назад

    import pywt
    ModuleNotFoundError: No module named 'pywt'
    While. I was. tying to love using.pycharm. ,getting this error

  • @vnkt_ayyappa
    @vnkt_ayyappa Год назад

    Good Evening sir @codebasics
    i am having an error with how can i resolve when i try to install it gives another error as
    ERROR: Could not find a version that satisfies the requirement pywt (from versions: none)
    ERROR: No matching distribution found for pywt
    WARNING: You are using pip version 21.3.1; however, version 23.1.2 is available.
    You should consider upgrading via the 'D:\JupyterTest\Intro to Numpy\Image Classification\venv\Scripts\python.exe -m pip install --upgrade pip' command.
    import pywt
    can you please look into this error and how can I rectify it.

    • @Lyricverse116
      @Lyricverse116 6 месяцев назад +1

      remove any versions that is mentioned in requirements.txt file keep only PyWavelets
      opencv-python
      seaborn
      flask
      joblib like this

  • @yamansaini6379
    @yamansaini6379 Год назад

    it shows the error ModuleNotFoundError: No module named 'sklearn.preprocessing.data' can anyone help

    • @JOXAVLOGS
      @JOXAVLOGS Год назад

      Hello, Did you solve it?

  • @SunilKumar-jw1lv
    @SunilKumar-jw1lv 4 года назад

    I am getting this error
    import pywt
    ModuleNotFoundError: No module named 'pywt'

  • @lucasbegue8232
    @lucasbegue8232 4 года назад

    encoded_data = b64str.split(",")[1]
    IndexError: list index out of range
    any ideas? i just used another base64 web page transformer and another image

    • @bhaveshkumar3578
      @bhaveshkumar3578 4 года назад

      I also have same problem
      Did you solved?

    • @felipe7703
      @felipe7703 3 года назад +3

      @@bhaveshkumar3578 There are two ways of solving this, by either using the same website that he used to convert the image (www.base64-image.de/) or by using another converter of your choice AND modifying the "util.py" file. For the latter case, in the "util.py" file, line 60, where it says: "encoded_data = b64str.split(',')[1]", rewrite it as: "encoded_data = b64str". The reason for this error is that the web converter that he used generates a string with two parts divided by a comma ",". The first part contains " data:image/jpeg;base64" which is useless and should be ignored and the second part is the image binary data per se which is what we want, and he wrote the code to accommodate this fact by splitting them up and selecting only the second part, thus "b64str.split(',')[1]". Hopefully this was clear enough. Best of luck!

    • @bhaveshkumar3578
      @bhaveshkumar3578 3 года назад

      @@felipe7703 Thanks bro I will try to solve it

  • @alexandersc1750
    @alexandersc1750 4 года назад

    THANKSSSS!!!!

  • @nareshkumarvanga3127
    @nareshkumarvanga3127 2 месяца назад

    Video quality was not good

  • @dholanaresh2584
    @dholanaresh2584 4 года назад

    Thanky you very much dhaval for making a real time end to end machine learning project with classification. I have implement the code upto 6 th video in my pycharm but it will not give the classification output.I have tried with your code which you have uploaded on your github profile and also i have tried with my self which you explanied small code of snippet for Flask server but when i run the util.py file its give an error.
    Below i getting the error.
    Traceback (most recent call last):
    File "D:/CelebrityFaceRecognition/server/util.py", line 91, in
    load_saved_artifacts()
    File "D:/CelebrityFaceRecognition/server/util.py", line 50, in load_saved_artifacts
    __model = joblib.load(f)
    File "C:\Users\Naresh\Anaconda3\lib\site-packages\joblib
    umpy_pickle.py", line 575, in load
    obj = _unpickle(fobj)
    File "C:\Users\Naresh\Anaconda3\lib\site-packages\joblib
    umpy_pickle.py", line 504, in _unpickle
    obj = unpickler.load()
    File "C:\Users\Naresh\Anaconda3\lib\pickle.py", line 1085, in load
    dispatch[key[0]](self)
    File "C:\Users\Naresh\Anaconda3\lib\pickle.py", line 1373, in load_global
    klass = self.find_class(module, name)
    File "C:\Users\Naresh\Anaconda3\lib\pickle.py", line 1423, in find_class
    __import__(module, level=0)
    File "C:\Users\Naresh\Anaconda3\lib\site-packages\sklearn\__init__.py", line 134, in
    from .base import clone
    File "C:\Users\Naresh\Anaconda3\lib\site-packages\sklearn\base.py", line 13, in
    from .utils.fixes import signature
    File "C:\Users\Naresh\Anaconda3\lib\site-packages\sklearn\utils\__init__.py", line 10, in
    from .validation import (as_float_array,
    File "C:\Users\Naresh\Anaconda3\lib\site-packages\sklearn\utils\validation.py", line 18, in
    from ..utils.fixes import signature
    File "C:\Users\Naresh\Anaconda3\lib\site-packages\sklearn\utils\fixes.py", line 144, in
    from scipy.sparse.linalg import lsqr as sparse_lsqr # noqa
    File "C:\Users\Naresh\Anaconda3\lib\site-packages\scipy\sparse\linalg\__init__.py", line 114, in
    from .isolve import *
    File "C:\Users\Naresh\Anaconda3\lib\site-packages\scipy\sparse\linalg\isolve\__init__.py", line 6, in
    from .iterative import *
    File "C:\Users\Naresh\Anaconda3\lib\site-packages\scipy\sparse\linalg\isolve\iterative.py", line 10, in
    from . import _iterative
    ImportError: DLL load failed: The specified module could not be found.
    Process finished with exit code 1
    does any one have get the output from util.py file then please help me to solve this proble.I aslo attached my email id : dholanaresh26@gmail.com. Thanks in advanced for helping to this tutorial.

    • @bhupeshdewangan8461
      @bhupeshdewangan8461 2 года назад

      i m getting the same problem

    • @JOXAVLOGS
      @JOXAVLOGS Год назад

      same problems I have tried with pycharm vscode ........ error error

    • @tusharchawla1440
      @tusharchawla1440 11 месяцев назад

      @@JOXAVLOGS I am also getting same error.Did you solve it?

  • @avinashreddyc8271
    @avinashreddyc8271 3 месяца назад

    Don't teach packages as Machine Learning half the prople will not understand the under the hood logic of the packages are working understand the maths everyone pls 🙏🙏