Skip to content

The repository provides code for automatic segmentation using YOLOv5 and Segment Anything Model (SAM), which is used to create stickers.

Notifications You must be signed in to change notification settings

k-byzid/YOLOv5-plus-SAM-sticker-generator

Repository files navigation

YOLOv5 + Segment Anything Model Sticker Generator 🔍✂️

Description

Welcome to the YOLOv5 + Segment Anything Model project! 🚀 ✨ This project combines the power of the YOLOv5 object detection model with the Segment Anything Model from Meta Research to create bounding boxes, perform segmentation, and extract stickers in RGBA format from images, saving the output as PNG files. The project also includes a script that automates the process, although currently it only runs on CPU.

Features

🚀 Object detection with YOLOv5 🔍 Image segmentation with Segment Anything 🎨 Sticker extraction in RGBA format 🖼️ Automation script for easy usage 💡 Jupyter notebook for visualization

Installation and Usage

  1. 🍴 Fork the repository to your GitHub account.
  2. ⬇️ Clone the forked repository to your local machine.
  3. 💿 Navigate to the local repository using the command line.
  4. 💻 Run the script using the following command:
    python sticker_script.py --input_image assets/dog.jpg,
    where assets/dog.jpg is the path to the input image you want to generate stickers from.
  5. ✉️ The generated stickers will be saved in the "results" folder for further usage.

Usage Preview

Input image - - Output Sticker:


Input Image Output Sticker

Input Image Output Sticker

Requirements

The following dependencies are required to run the YOLOv5 and Segment Anything Sticker Generator:

  1. Python 3.x
  2. YOLOv5
  3. Segment Anything
  4. Pytorch >= 1.7
  5. Torchvision >= 0.8
  6. PIL (Python Imaging Library)
  7. Numpy

You can install these dependencies manually using the package manager of your choice.

About

The repository provides code for automatic segmentation using YOLOv5 and Segment Anything Model (SAM), which is used to create stickers.

Topics

Resources

Stars

Watchers

Forks