Kaan Baturalp COŞDAN (Takım Kaptanı)
Turabi YILDIRIM (Üye)
Hüsamettin IŞIKTAŞ (Üye)
This project was realized as part of the e-Commerce Hackathon organized by the Turkish Technology Team and Trendyol. The project aims to balance the inequality of opportunity for sellers living in rural areas by providing inexpensive and accessible solutions to the costs of copywriting and professional product shooting required to sell on e-commerce platforms. In this context, the project provides a solution to this problem by utilizing technologies such as LLM and Computer Vision on the amateur product image and short description received from the user.
In this project, the “Meta-LLaMA 3.2 Vision-Instruct” LLM model is used as the basis. This model has natural language processing as well as computer vision capabilities and was chosen because it is efficient and useful. Distortions caused by perspective shifts in the image were corrected by using various image processing algorithms such as Hough Lines. In order to make the image received from the user look more professional, a background replacement process was applied to the subject in the image, for which ComfyUI, which provides ease of use for the use of various Diffussion models, was preferred. Addiniotally, Gradio is used in this project for both frontend and backend services.
Project pipeline is mentioned above.
- Model: LLaMA 3.2 - 11B Vision Instruct model from Meta
- Libraries used:
transformers
by Hugging Facetorch
for deep learning frameworkGradio
for
- Functionality:
- Generate text-based descriptions from image inputs & product info that user gave.
- Generate fancy backgrounds using Diffusing models.
- Take feedback from user about generated product descriptions and revise it.
-
Clone the repository:
git clone <repository-url>
-
Install dependencies:
Ensure you have Python 3.x installed. Then install the required packages with the following command:
pip install -r requirements.txt
-
Provide your Huggingface Login Token:
from huggingface_hub import login login("YOUR_LOGIN_TOKEN_HERE")
-
Run the notebook end to end You can do it shortly from "Run" menu in your notebook enviroment
-
Go to website provided by Gradio After execution of all code blocks, Gradio provides a public URL that you can access to project via web interface. Using this interface you are able to use project easily.
- GPU recommended: This model requires significant memory. It is highly recommended to run it on a machine with a GPU.
- Model weights: Make sure to load the model correctly using Hugging Face's API.
- Error handling: If you encounter errors with
tie_weights
, make sure you tie model weights using the respective method before running inference.
Bu proje, Türkiye Teknoloji Takımı ve Trendyol tarafından düzenlenen e-Ticaret Hackathonu kapsamında geliştirilmiştir. Proje, merkezinde e-ticaret platformlarında satış yapabilmek için gerekli olan metin yazarlığı ve profesyonel ürün çekimi maliyetlerine ucuz ve erişilebilir çözümler sunarak kırsal kesimde yaşayan satıcılar için fırsat eşitsizliğini dengelemeyi amaçlamaktadır. Bu kapsamda proje, kullanıcıdan alınan amatör ürün görseli ve kısa açıklama üzerinde LLM ve Computer Vision gibi teknolojilerden yararlanarak bu soruna çözüm üretmektedir.
Bu projede temel olarak “Meta-LLaMA 3.2 Vision-Instruct” LLM modeli kullanılmaktadır. Bu model doğal dil işlemenin yanı sıra bilgisayarla görme yeteneklerine de sahiptir ve verimli ve kullanışlı olduğu için seçilmiştir. Görüntüdeki perspektif kaymalarından kaynaklanan bozulmalar Hough Çizgileri gibi çeşitli görüntü işleme algoritmaları kullanılarak düzeltilmiştir. Kullanıcıdan alınan görüntünün daha profesyonel görünmesi için görüntüdeki özneye arka plan değiştirme işlemi uygulanmış, bunun için de çeşitli Diffussion modellerinin kullanımı için kullanım kolaylığı sağlayan ComfyUI tercih edilmiştir. Ayrıca bu projede hem frontend hem de backend servisleri için Gradio kullanılmıştır.
Projeye ait pipeline yukarıda gösterilmiştir.
- Model: Meta LLaMA 3.2 - 11B Vision Instruct model
- Kullanılan kütüphaneler:
- Hugging Face tarafından
transformers
- derin öğrenme çerçevesi için
torch
- için
Gradio
- Hugging Face tarafından
- İşlevsellik:
- Kullanıcının verdiği resim girdilerinden ve ürün bilgilerinden metin tabanlı açıklamalar oluşturun.
- Diffusing modellerini kullanarak dikkat çekici arka planlar oluşturun.
- Oluşturulan ürün açıklamaları hakkında kullanıcıdan geri bildirim alın ve revize edin.
-
Depoyu klonlayın:
git clone <repository-url>
-
Bağımlılıkları yükleyin:
Python 3.x'in kurulu olduğundan emin olun. Daha sonra aşağıdaki komut ile gerekli paketleri yükleyin:
pip install -r requirements.txt
-
Huggingface Giriş tokenini sağlayın:
from huggingface_hub import login login(“YOUR_LOGIN_TOKEN_HERE”)
-
Not defterindeki kod bloklarını baştan sona yürütün Bunu notebook ortamınızdaki “Çalıştır” menüsünden kısaca yapabilirsiniz
-
Gradio tarafından sağlanan web sitesine gidin Tüm kod bloklarının yürütülmesinden sonra Gradio, web arayüzü aracılığıyla projeye erişebileceğiniz genel bir URL sağlar. Bu arayüzü kullanarak projeyi kolayca kullanabilirsiniz.
- GPU önerilir: Bu model önemli miktarda bellek gerektirir. GPU'lu bir makinede çalıştırılması şiddetle tavsiye edilir.
- Model ağırlıkları: Hugging Face'in API'sini kullanarak modeli doğru şekilde yüklediğinizden emin olun.
- Hata işleme:**
tie_weights
ile ilgili hatalarla karşılaşırsanız, çıkarımı çalıştırmadan önce ilgili yöntemi kullanarak model ağırlıklarını bağladığınızdan emin olun.