ifurkanatasoy/TEKNOFEST2024-3rd-Place-E-Ticaret-Hackathon

TEKNOFEST 2024 E-Ticaret Hackathonu 3.'lük Derecesi Alan Proje

Python

3

14 commits

updated Oct 3, 2024

See the code

README

Competition Scope

The goal of the Teknofest E-Commerce Hackathon, sponsored by Trendyol, is to enhance product photos uploaded by local sellers and generate more professional product descriptions using Generative AI.

[!NOTE] Special thanks to Trendyol for providing us with a productive and supportive working environment throughout the competition.

Presentation

You can view the presentation here.

Quick Start Guide

Requirements

  1. Python: To use this code you have to be using Python 3.10 or higher.
  2. Dependencies: Install dependencies from the requirements.txt file using the following code:
pip install -r requirements.txt

Running the Application

To get started, follow these steps:

  1. Now to run the code, you need to use Streamlit. Run the app.py file using the following code:
streamlit run app.py
  1. Open another terminal and install pyngrok if you haven't already:
pip install pyngrok
  1. Set it up:
ngrok config add-authtoken "$YOUR_AUTHTOKEN"
ngrok http 8501

after setting it up a link will pop up indicated with Forwarding, click it to open the page.

[!NOTE] You have to Sign up for ngrok to able to run it. Obtain your authtoken from Your Autotoken page. Now you're ready to go and run the code 🎉

Overview of Code Functionality

Background Removal

Our Streamlit application contains two tabs. The first tab is for background removal. To get the output, you simply need to:

  1. Upload an image of the product.
  2. Enter the description of the product you want.
  3. Choose the language in which you want the output.

User Interface:

Result:

BeforeAfter

Object Removal

The second tab provides an object removal feature. Here’s how it works:

  1. Upload an image.
  2. A screen will pop up displaying two images:
    • Original image
    • Draw mask
    • Generated mask
  3. Use your cursor to draw on the "Draw mask" image, marking the area you want to remove. You will see the generated mask on the right.
  4. After that, similar to the first tab, enter your description, choose the language for the output, and click the "Send" button.

User Interface:

Result:

BeforeAfter

Upscaling

In addition to the object and background removal features already present in our application, we've introduced an image upscaling function. After removing an object or background, the image is automatically upscaled to enhance its resolution. This ensures that both our model and the user can view even the finest details with clarity, delivering a more refined and high-quality result. This enhancement improves the overall user experience by providing sharper and more detailed images post-processing.

Result:

Text Generation

We've added a powerful text generation feature in both tabs of our application. After hitting the "Send" button, our models generate a detailed product description based on both the provided image and prompt. So to say, the Llama 3.2-11B-Vision model serves as the eyes of the Gemma-2-27B-IT model. We produce professional results with Gemma by incorporating the information extracted by the Llama Vision model.

As you can see in the first example, although we did not explicitly state that the product is "sugar-free," the Llama Vision model correctly identified it as such.

Result:

Used System Specifications

  • 1 NVIDIA A100-SXM4-40GB GPU
  • 85 GB RAM
  • 12 vCPUs

[!WARNING]
You may experience issues running this on less powerful hardware.

Models Used

This project makes use of the following models:

  1. google/gemma-2-27b-it:

  2. meta-llama/Llama-3.2-11B-Vision:

  3. ZhengPeng7/BiRefNet:

  4. fal/AuraSR-v2:

    • Source: fal
    • License: Creative Commons Attribution Share Alike 4.0 International License
  5. diffusers/stable-diffusion-xl-1.0-inpainting-0.1:

[!NOTE] Please ensure compliance with each model's license when using or distributing this project.

Contributors

ifurkanatasoy/TEKNOFEST2024-3rd-Place-E-Ticaret-Hackathon

TEKNOFEST 2024 E-Ticaret Hackathonu 3.'lük Derecesi Alan Proje

Python

3

14 commits

updated Oct 3, 2024

See the code

README

Competition Scope

The goal of the Teknofest E-Commerce Hackathon, sponsored by Trendyol, is to enhance product photos uploaded by local sellers and generate more professional product descriptions using Generative AI.

[!NOTE] Special thanks to Trendyol for providing us with a productive and supportive working environment throughout the competition.

Presentation

You can view the presentation here.

Quick Start Guide

Requirements

  1. Python: To use this code you have to be using Python 3.10 or higher.
  2. Dependencies: Install dependencies from the requirements.txt file using the following code:
pip install -r requirements.txt

Running the Application

To get started, follow these steps:

  1. Now to run the code, you need to use Streamlit. Run the app.py file using the following code:
streamlit run app.py
  1. Open another terminal and install pyngrok if you haven't already:
pip install pyngrok
  1. Set it up:
ngrok config add-authtoken "$YOUR_AUTHTOKEN"
ngrok http 8501

after setting it up a link will pop up indicated with Forwarding, click it to open the page.

[!NOTE] You have to Sign up for ngrok to able to run it. Obtain your authtoken from Your Autotoken page. Now you're ready to go and run the code 🎉

Overview of Code Functionality

Background Removal

Our Streamlit application contains two tabs. The first tab is for background removal. To get the output, you simply need to:

  1. Upload an image of the product.
  2. Enter the description of the product you want.
  3. Choose the language in which you want the output.

User Interface:

Result:

BeforeAfter

Object Removal

The second tab provides an object removal feature. Here’s how it works:

  1. Upload an image.
  2. A screen will pop up displaying two images:
    • Original image
    • Draw mask
    • Generated mask
  3. Use your cursor to draw on the "Draw mask" image, marking the area you want to remove. You will see the generated mask on the right.
  4. After that, similar to the first tab, enter your description, choose the language for the output, and click the "Send" button.

User Interface:

Result:

BeforeAfter

Upscaling

In addition to the object and background removal features already present in our application, we've introduced an image upscaling function. After removing an object or background, the image is automatically upscaled to enhance its resolution. This ensures that both our model and the user can view even the finest details with clarity, delivering a more refined and high-quality result. This enhancement improves the overall user experience by providing sharper and more detailed images post-processing.

Result:

Text Generation

We've added a powerful text generation feature in both tabs of our application. After hitting the "Send" button, our models generate a detailed product description based on both the provided image and prompt. So to say, the Llama 3.2-11B-Vision model serves as the eyes of the Gemma-2-27B-IT model. We produce professional results with Gemma by incorporating the information extracted by the Llama Vision model.

As you can see in the first example, although we did not explicitly state that the product is "sugar-free," the Llama Vision model correctly identified it as such.

Result:

Used System Specifications

  • 1 NVIDIA A100-SXM4-40GB GPU
  • 85 GB RAM
  • 12 vCPUs

[!WARNING]
You may experience issues running this on less powerful hardware.

Models Used

This project makes use of the following models:

  1. google/gemma-2-27b-it:

  2. meta-llama/Llama-3.2-11B-Vision:

  3. ZhengPeng7/BiRefNet:

  4. fal/AuraSR-v2:

    • Source: fal
    • License: Creative Commons Attribution Share Alike 4.0 International License
  5. diffusers/stable-diffusion-xl-1.0-inpainting-0.1:

[!NOTE] Please ensure compliance with each model's license when using or distributing this project.

Contributors