Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/raj-pulapakura/image-search-engine
Upload an image and find similar images easily!
https://github.com/raj-pulapakura/image-search-engine
ai aws bentoml computer-vision image-processing machine-learning mobilenetv3 neural-network nextjs pytorch resnet50 responsive searchengine siamese-network vercel
Last synced: 1 day ago
JSON representation
Upload an image and find similar images easily!
- Host: GitHub
- URL: https://github.com/raj-pulapakura/image-search-engine
- Owner: raj-pulapakura
- Created: 2023-06-12T05:06:40.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2023-06-24T12:40:24.000Z (over 1 year ago)
- Last Synced: 2024-11-10T00:29:49.859Z (about 2 months ago)
- Topics: ai, aws, bentoml, computer-vision, image-processing, machine-learning, mobilenetv3, neural-network, nextjs, pytorch, resnet50, responsive, searchengine, siamese-network, vercel
- Language: Jupyter Notebook
- Homepage: https://image-search-pro.vercel.app
- Size: 204 MB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ๐ Image Search Engine
![Screenshot 2023-06-24 182046](https://github.com/raj-pulapakura/Image-Search-Engine/assets/87762282/21702ad9-6cfe-4a5d-8385-cc65fad8eded)
- โ **Project Duration**: June 12 to June 24
- โ๏ธ **Main tech**: PyTorch, BentoML, NextJS, Vercel
- ๐ฆ **Purpose**: Drag and drop (or upload) an image and find similar images
- ๐ป **Check it out**: https://image-search-pro.vercel.app/
- ๐ท **Video demonstration**: https://www.youtube.com/watch?v=loBZkPvn29c# ๐ค Website
- ๐ช **Frontend framework**: NextJS
- ๐ง๏ธ **Deployment**: Vercel
- ๐ป **Check it out**: https://image-search-pro.vercel.app/
- ๐ท **Video demonstration**: https://www.youtube.com/watch?v=loBZkPvn29c## Usage
1. Upload (or drag and drop) an image into the website
![Screenshot 2023-06-24 192730](https://github.com/raj-pulapakura/Image-Search-Engine/assets/87762282/8b220bec-a8e8-4972-af6c-bee80211b73c)
2. Find and download similar images
![Screenshot 2023-06-24 193050](https://github.com/raj-pulapakura/Image-Search-Engine/assets/87762282/46ac6e74-4c80-4285-86fa-558bd4461124)
# ๐ค Backend
- ๐ฐ **ML Framework**: PyTorch
- ๐ **Backend Framework**: BentoML
- ๐ง๏ธ **Deployment method**: BentoCTL, AWS and Terraform
- ๐ **API Link**: https://shzs1c1u45.execute-api.ap-southeast-2.amazonaws.com/predict![Model Overview](https://github.com/raj-pulapakura/Image-Search-Engine/assets/87762282/a9d04a84-95cd-4aec-9123-725eeb1b66ea)
## ๐งช Test the API with Postman
1. Open up Postman and paste the aforementioned API Link
2. Make sure the request METHOD is set to "POST"
3. Go to "Body" and select "form-data"
4. Add a new file key named "image" and upload a file from your PC
5. Hit "Send"![Screenshot 2023-06-24 183540](https://github.com/raj-pulapakura/Image-Search-Engine/assets/87762282/f91b628a-8e9a-40d3-8adc-55207cb4bd9b)
## ๐ฐ Backend: ML
I began my project with TensorFlow, but due to model size issues, I transitioned to PyTorch. MobileNetV3 architecture was utilized to reduce the model size and improve inference speed. I employed a MobileNetV3 model for classification and a Siamese MobileNetV3 network for similarity scoring. This combination of frameworks and architectures enabled me to achieve smaller models without compromising performance
- ๐ถ **Classifier**:
- Architecture: MobileNetV3
- Purpose: Classify the input images. The output label (e.g. Labrador Retriever) is used to fetch 50 images from Unsplash.
- ๐ **Siamese network**:
- Architecture: 2 MobileNetV3 models
- Purpose: Calculate similarity scores for each of the 50 images and the input image. The 20 most similar images, i.e. the images with the best similarity scores, are returned.## ๐ Backend: server code
After experimenting with different backend frameworks such as FastAPI and Flask, I came across [BentoML](https://github.com/bentoml), which is a tool that makes ML API creation and deployment effortless.
## ๐ง๏ธ Backend: deployment
BentoML offers a tool called [bentoctl](https://github.com/bentoml/bentoctl), which is used to deploy BentoML services to production ready API endpoints in the cloud. It does this using [AWS Lambda](https://aws.amazon.com/lambda/), [AWS API Gateway](https://aws.amazon.com/api-gateway/), and [AWS ECR](https://aws.amazon.com/ecr/), whilst using [Terraform](https://www.terraform.io/) to automate the creation of this infrastructure.# ๐ Summary
## โ๏ธ Technologies
This project exposed me to many different technologies involved in ML application deployment, as well full stack development.
Tech used:
- Frontend: NextJS, Vercel
- Backend: PyTorch, BentoML, AWS, Terraform## ๐ก What I learnt
- ๐โโ๏ธ **Model optimization**: In my quest to achieve lower inference times, I had to switch from Tensorflow to PyTorch and from ResNets to MobileNet. This process was painstaking, however it taught me the value of different model architectures and how some are better suited for application development.
- ๐ง๏ธ **Deployment**: I was exposed to different technologies involved in the deployment process including Docker and AWS.
- ๐ซก **Never give up**: This may sound cliche, but it's a timeless mantra which applies no matter what field you are in. Many times throughout the project I was faced with a challenge or an error which made me want to give up. But through persistence and grit, I managed to overcome these challenges and eventually produce a functional ML application.