vlvink/Marketplace-Image-Processor

This repository is dedicated to solving the test e-commerce task for the educational shift on machine learning in Sirius 2024. The main task was to implement a system for processing product cards from marketplaces.

Python

8

11 commits

updated Sep 28, 2024

See the code

README

Marketplace-Image-Processor

The project is a solution to an e-commerce problem: developing a system for processing photos from product cards on marketplaces.

It performs the following actions:

  • Removing the background
  • Replacing the background
  • Description generation

Installation

To run this project, you'll need to set up a Python environment and install the necessary dependencies.

Prerequisites

Make sure you have Python 3.10 or higher installed.

  1. Clone the repository:
git clone https://github.com/vlvink/Marketplace-Image-Processor.git
cd Marketplace-Image-Processor
  1. Install the requirements
poetry install
  1. Setting the poetry environment
poetry shell

Running the Code

Before running code download file u2net.pth and put it into models/params/u2net/

To run the code, you need to configure Streamlit app

streamlit run src/start_page.py

For stopping session press the keyboard shortcut Ctrl+C in the terminal.

The first launch

The first launch of the Web service on the Streamlit platform will be accompanied by loading weights and initializing models Params downloading

Params downloading At the first launch, you will need to wait for some time until the models are initialized and the system is ready for use

Demos

Web app UI interface

UI interface

Intermediate results

UI interface intermediate

Final output

Final output image

Project Organization

├── LICENSE
├── README.md          <- The top-level README for developers using this project
├── data
│   └── bg_themes      <- Background image styles.
│   │   ├── dark_bg_theme.JPG      <- Dark background image file
│   │   └── light_bg_theme.JPG     <- Light background image file
│
├── models             <- Trained and serialized models, model predictions, or model summaries
│   ├── params         <- Model's parameters in .pth files
│   │   ├── blip       <- Pretrain configuration for BLIP model
│   │   ├── u2net      <- Directory for u2net parameters
│   │   
│   └── predictions    <- Model's predictions: intermediate model responses
│
├── notebooks          <- Jupyter notebooks. Test code, training code
│
├── src                <- Source code for use in this project
│   ├── __init__.py    <- Makes src a Python module
│   │
│   ├── applications   <- Code with applications for Streamlit app
│   │   └── apply_bg.py
│   │
│   ├── start_page.py  <- Launches the Streamlit app to demonstrate how the models work
│   │
│   ├── data           <- Scripts to modify data
│   │   └── image_processing.py
│   │
│   ├── models         <- Scripts to train models and then use trained models to make
│   │   │              predictions
│   │   ├── blip       <- Code for initializing and using BLIP model (Image2Text)
│   │   │   ├── blip_init.py
│   │   │   └── blip_model_utils.py
│   │   │
│   │   ├── u2net      <- Code for initializing and using U2-Net model (Semantic segmentation)
│   │   │   ├── u2net_init.py
│   │   │   ├── u2net_model_utils.py
│   │   │   ├── u2net_model.py
│   │   │   └── u2net_processor.py
│   │   │
│   │   ├── madlad400  <- Code for initializing and using MADLAD400 model (Translating)
│   │   │   ├── madlad400_init.py
│   │   │   └── translate.py
│
└── tox.ini            <- tox file with settings for running tox
computer-vision
deep-learning
machine-learning
mlops
nlp
python

vlvink/Marketplace-Image-Processor

This repository is dedicated to solving the test e-commerce task for the educational shift on machine learning in Sirius 2024. The main task was to implement a system for processing product cards from marketplaces.

Python

8

11 commits

updated Sep 28, 2024

See the code

README

Marketplace-Image-Processor

The project is a solution to an e-commerce problem: developing a system for processing photos from product cards on marketplaces.

It performs the following actions:

  • Removing the background
  • Replacing the background
  • Description generation

Installation

To run this project, you'll need to set up a Python environment and install the necessary dependencies.

Prerequisites

Make sure you have Python 3.10 or higher installed.

  1. Clone the repository:
git clone https://github.com/vlvink/Marketplace-Image-Processor.git
cd Marketplace-Image-Processor
  1. Install the requirements
poetry install
  1. Setting the poetry environment
poetry shell

Running the Code

Before running code download file u2net.pth and put it into models/params/u2net/

To run the code, you need to configure Streamlit app

streamlit run src/start_page.py

For stopping session press the keyboard shortcut Ctrl+C in the terminal.

The first launch

The first launch of the Web service on the Streamlit platform will be accompanied by loading weights and initializing models Params downloading

Params downloading At the first launch, you will need to wait for some time until the models are initialized and the system is ready for use

Demos

Web app UI interface

UI interface

Intermediate results

UI interface intermediate

Final output

Final output image

Project Organization

├── LICENSE
├── README.md          <- The top-level README for developers using this project
├── data
│   └── bg_themes      <- Background image styles.
│   │   ├── dark_bg_theme.JPG      <- Dark background image file
│   │   └── light_bg_theme.JPG     <- Light background image file
│
├── models             <- Trained and serialized models, model predictions, or model summaries
│   ├── params         <- Model's parameters in .pth files
│   │   ├── blip       <- Pretrain configuration for BLIP model
│   │   ├── u2net      <- Directory for u2net parameters
│   │   
│   └── predictions    <- Model's predictions: intermediate model responses
│
├── notebooks          <- Jupyter notebooks. Test code, training code
│
├── src                <- Source code for use in this project
│   ├── __init__.py    <- Makes src a Python module
│   │
│   ├── applications   <- Code with applications for Streamlit app
│   │   └── apply_bg.py
│   │
│   ├── start_page.py  <- Launches the Streamlit app to demonstrate how the models work
│   │
│   ├── data           <- Scripts to modify data
│   │   └── image_processing.py
│   │
│   ├── models         <- Scripts to train models and then use trained models to make
│   │   │              predictions
│   │   ├── blip       <- Code for initializing and using BLIP model (Image2Text)
│   │   │   ├── blip_init.py
│   │   │   └── blip_model_utils.py
│   │   │
│   │   ├── u2net      <- Code for initializing and using U2-Net model (Semantic segmentation)
│   │   │   ├── u2net_init.py
│   │   │   ├── u2net_model_utils.py
│   │   │   ├── u2net_model.py
│   │   │   └── u2net_processor.py
│   │   │
│   │   ├── madlad400  <- Code for initializing and using MADLAD400 model (Translating)
│   │   │   ├── madlad400_init.py
│   │   │   └── translate.py
│
└── tox.ini            <- tox file with settings for running tox
computer-vision
deep-learning
machine-learning
mlops
nlp
python