balajibonageri / Image-Recognition-with-ResNet50

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Image Recognition with ResNet50

This Python code uses the ResNet50 model, which is a pre-trained deep learning model, to recognize the image and predict its class with a certain level of accuracy. The code is written using Python, and it requires OpenCV, Matplotlib, and TensorFlow libraries to be installed.

How to use the code

The code loads a pre-trained ResNet50 model and predicts the class of an input image. You can change the image source by replacing the imageSrc variable with the path to your image. You can also change the top number of predictions by modifying the top parameter in the decode_predictions function.

Prerequisites

Before executing the code, you must have the following installed:

  • Python 3.x
  • OpenCV
  • Matplotlib
  • TensorFlow

To install these dependencies, you can use the following commands:

pip install opencv-python
pip install matplotlib
pip install tensorflow

Steps to Execute the Code

  1. Clone or download the repository to your local machine.
  2. Navigate to the directory where the files are located
  3. Open the command prompt and run the following command to execute the code:
  4. jupyter lab

  5. Run main.ipynb in jupyter lab
  6. The code will load the ResNet50 model, preprocess the image, and predict the class of the input image
  7. The output will be displayed in the command prompt, showing the predicted class and accuracy percentage.
  8. Additionally, the image will be displayed using Matplotlib.

Customization

To customize the code for your own use, you can change the imageSrc variable to point to your own image file. You can also modify the top parameter in the decode_predictions function to change the number of predictions displayed.

About


Languages

Language:Jupyter Notebook 100.0%