
Learn to create a Python convolutional neural network model with transfer learning for car damage detection and deploy it in production via Django front end with REST API and Bootstrap.
This is a proof of concept created for possible automation of the car damage detection process. The model has been created using CNN Architecture on Keras and transfer learning utilizing the VGG16 model. Django 1.10 has been used to create a full stack website.
This POC has been created using AJAX. The intent is to render the results on the same page without refresh. Single page portal means you can upload the image and get the results on the same page. The home page for the portal is still there and it can be utilized if you intent to add more features. If you want, you can remove it and can create a portal with only one page.
POC 3.0 will have KYC functionality integrated which will enable user to identify the type of id card uploaded, based on training. The classifier used in this POC has been trained on Pan card and Adhaar card.
Important information about Django Version
At the time of developing this app, I utilised the Django version 1.10.
My recommendation would be to follow along the course and create the POC using Django version 1.10. Once you have successfully created the application, then you can go ahead and upgrade to the latest Django version. As of May 2021, the latest Django version is 3.2.2
Try to upgrade the Django version on your own. Its pretty straight forward and very simple upgrade. In case of any challenges, I have uploaded a new section(Section 8) at the bottom of this course. It contains all the code files, models and templates etc along with requirements.txt file that you can use to upgrade the application.
Thanks and wish you all the best. Happy learnings!!!
Install Anaconda with Python 3.7, configure Django via the Anaconda prompt, and install Atom, then explore Navigator and Jupyter notebooks for Django coding.
Learn how to create and activate/deactivate Anaconda Environment, how to launch Jupyter Notebook from Anaconda prompt, basics of python and how to write functions and class in Jupyter Notebook.
Learn to run Python scripts from the Anaconda prompt, import NumPy and Matplotlib, and plot data in a Jupyter notebook. Create simple functions and classes to model and visualize results.
Explore building a Python/Django computer vision model using CNN and transfer learning to detect car images, check damage status, locate damage, and assess severity to generate a final report.
Explore how CNNs create feature maps with detectors, apply ReLU nonlinearity, pool to reduce size, flatten, and feed into a fully connected classifier to label images.
Create and deploy a computer vision model in Python/Django by training a model, extracting top predictions, building a car category list, and validating whether an image depicts a car.
This lecture demonstrates building a two-class car damage detector using transfer learning on the video 16 base, extracting features, encoding labels, and training a logistic regression classifier.
Train a logistic regression classifier on extracted features to distinguish damaged from whole cars, evaluate with a confusion matrix, and save the pickle model for future use.
Determine car damage location by building a three-class logistic regression model (front, rear, side), training on labeled images, and saving features, labels, and the trained model.
Train a logistic regression model on features and labels from damaged car images (front, rear, and side), save the classifier, and evaluate with a confusion matrix at about 69.9% accuracy.
Load the trained classifier and extract features using the base model to predict car damage location (front, rear, side) for new images in the third check.
Train a three-class classifier that labels car damage as minor, moderate, or severe, using a deep feature extractor, with data preparation, labeling, and saving features, labels, and the trained model.
Learners implement a four-check pipeline to assess car damage severity using a logistic classifier, from car detection to damage location and severity levels, with evaluation notes.
Combine four models for checks into one Python and Django full-stack engine, loading pretrained classifiers in a notebook and deploying with a Django-based front end.
Understand the full stack architecture of the car damage portal, detailing how the frontend and backend integrate using HTML, CSS, JavaScript, and Python Django.
Build the home page of the portal by creating a navigation bar with two links, adding a car image background, and using bootstrap container divs to structure the page.
Create a reusable Django home page using a base template with blocks for a shared navigation bar, then extend it for page content and style with a static CSS layout.
Build portal's second page in the Django app with a navigation bar and an image upload form that triggers the computer vision model and shows results on the third page.
Create the portal's second page with a form to upload an image and email, saving the image to the database via Django models, then render results on the third page.
this lecture builds the portal's second page with an image upload form, configures Django routes and settings, and saves images to a dedicated pick_up_load folder.
Display the uploaded image on the second portal page using the image tag and the uploaded file path, completing the front end. The third page integration follows.
Integrate client and server sides in a Django app to upload images, run a computer vision model for car damage, and display location, severity, and results on a portal.
Integrate client and server side in a Django portal for car damage assessment. Build the third page, enable image upload and processing, and reuse the navigation.
Create a simple Django project with an index page using templates and a basic view. Then learn how to host the page on PythonAnywhere.
Deploy a Django project to the internet by pushing code to GitHub, creating a PythonAnywhere web app, configuring WSGI, and applying migrations.
This section helps you code the portal using the magic of AJAX. It will help you render the results on the same page without refresh.
Note: The carcare_ajax.zip file that has been attached as a resource has all the files used in the code,except the vgg16.h5 file. It's a huge file and I have already posted it in section 4 with the lecture "Integration - Combining Client and Server Side - Part 2". The file can be found in the "static" folder. Copy it and save in the "static" folder of carcare_ajax to make the code work.
Build and save a logistic regression image classifier from new features and labels, train on a train/test split, and evaluate with a confusion matrix and accuracy.
Added as a resource all the files along with classifier and codes, except the VGG16 model. VGG16 file can be downloaded from the internet or the lectures above.
Upgrade a Django project to version 3.2.2 using pip, update four files, adjust imports like reverse, remove regex usage, and configure static files and requirements for a computer vision app.
This Course has been designed for the developers who are able to train ML/DL models, but they struggle when it comes to saving the model for future use or when it comes to deploying the model through a full stack portal.
This course will teach you how to train and create computer vision model from scratch, how to utilize transfer learning for feature extraction, how to save those models using pickle, and how to deploy the models using Django framework.