File size: 3,483 Bytes
0aef0a5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
93a21d5
 
0aef0a5
 
 
 
93a21d5
0aef0a5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
---
license: mit
language:
- en
base_model:
- google/deeplabv3_mobilenet_v2_1.0_513
pipeline_tag: image-to-image
tags:
- segmentation
- sticker
- deeplab
- image
- ai-sticker
---
# πŸ–ΌοΈ AI Sticker Generator API

Welcome to the **AI Sticker Generator API**! This API is designed to transform images into high-quality "stickers" by isolating the primary object using advanced **semantic segmentation** techniques. The stickers produced have smooth, feathered edges to ensure a polished and professional look.

## Examples

### Before and After Transformation

- **Before:** ![Before](output/check3.png)  
  **After:** ![After](output/sticker_check3.png)

- **Before:** ![Before](output/check.png)  
  **After:** ![After](output/sticker_check.png)

- **Before:** ![Before](output/check5.png)  
  **After:** ![After](output/sticker_check5.png)

## πŸ“‹ Key Features

### πŸ” Semantic Segmentation
Automatically identifies and isolates the main subject in an image, providing precise cutouts for clear and visually appealing stickers.

### 🌟 Feathered Edges
Applies a Gaussian blur to the mask edges, creating a soft and natural transition to transparency for a more polished finish.

### ⚑ Built with FastAPI
Utilizes FastAPI for high performance, scalability, and fast response times suitable for production environments.

### πŸ“‚ Versatile Image Support
Supports **PNG** and **JPEG** formats, ensuring compatibility with widely used image types.

## πŸš€ Quick Start Guide

Entire Code is on GitHub as well : ![URL]https://github.com/rajasami156/AI-Image-Sticker-Generator.git

1. **Clone the repository** and navigate to the project directory.
2. **Install dependencies** (requires Python 3.8+).
3. **Start the API server** using the provided configuration file.
4. Once the server is running, the API is accessible locally, ready to accept image uploads for sticker generation.
   

## πŸ› οΈ API Endpoints

### `POST /create_sticker/`
- **Description**: Upload an image to generate a sticker with a transparent background.
- **Supported File Types**: PNG and JPEG formats.
- **Response**: Returns a PNG image of the sticker with a transparent background. In case of an unsupported file format, an error message will be returned.

## 🧩 How It Works

1. **Model & Preprocessing**: Uploaded images are preprocessed and passed through a pre-trained model for semantic segmentation.
2. **Mask Generation**: A binary mask isolates the main object in the image.
3. **Edge Feathering**: A Gaussian blur is applied to mask edges, creating a smooth transition.
4. **Sticker Creation**: The mask adds transparency, producing an image that can be directly used as a sticker.

## πŸ“‚ Directory Structure

Generated stickers are saved in a designated output directory, ensuring easy access and organization of created stickers.

## βš™οΈ Configuration

Before running the application, confirm that the output directory exists. This directory is essential for storing generated stickers for easy retrieval and management.

## πŸ“œ License

Licensed under the MIT License, allowing easy adaptation and building upon this work.

## πŸ™‹β€β™‚οΈ Contributing

Contributions are welcome! To contribute, create a new issue or pull request for bug fixes, enhancements, or new features. All contributions should adhere to the project's coding standards and guidelines.

## Built with ❀️ by [SAMIULLAH]

## πŸ“ž Support

For support or inquiries, please contact nicesami156@gmail.com.