rdjarbeng commited on
Commit
45a4752
Β·
1 Parent(s): 1e9e55a

update readme with more detailed information

Browse files
Files changed (1) hide show
  1. README.md +114 -63
README.md CHANGED
@@ -1,115 +1,166 @@
1
  ---
2
  title: Free Background Remover
3
- emoji: πŸ“ˆ
4
- colorFrom: green
5
- colorTo: green
6
  sdk: gradio
7
- sdk_version: 5.31.0
8
  app_file: app.py
9
  pinned: false
10
  license: apache-2.0
11
- short_description: Free background remover without login or paywalls.
12
- tags: ['computer vision', 'rembg','u2net',isnet-general-use','isnet-anime','silueta','unet','u2netp','u2net_human_seg','u2net_cloth_seg']
13
  ---
14
 
 
15
 
16
- # Advanced Background Remover v2.2
17
 
18
- This project is a web-based tool for removing the background from images. It provides users with several advanced options such as background color replacement, model selection, alpha matting, and more, using the `rembg` library.
19
 
20
- ## Features
 
 
 
 
 
 
21
 
22
- - **Background Removal**: Automatically remove the background from images.
23
- - **Model Selection**: Choose from a variety of pre-trained models for different use cases, including general use, human segmentation, and anime character segmentation.
24
- - **Custom Background Color**: Replace the removed background with a custom color.
25
- - **Alpha Matting**: Improve the quality of the background removal with alpha matting.
26
- - **Post-Processing**: Option to post-process the mask for better results.
27
- - **Only Mask**: Option to return only the mask of the image without any background.
28
 
29
- ## Pre-Trained Models
 
 
 
 
 
 
 
 
 
30
 
31
- The following models are available for selection:
32
 
33
- - **u2net**: A pre-trained model for general use cases.
34
- - **u2netp**: A lightweight version of the u2net model.
35
- - **u2net_human_seg**: A pre-trained model for human segmentation.
36
- - **u2net_cloth_seg**: A pre-trained model for cloth parsing from human portraits.
37
- - **silueta**: Same as u2net but with a reduced size.
38
- - **isnet-general-use**: A new pre-trained model for general use cases.
39
- - **isnet-anime**: High-accuracy segmentation for anime characters.
40
- - **sam**: A pre-trained model for any use cases.
41
 
42
- ## Installation
43
-
44
- 1. Clone this repository:
45
 
 
46
  ```bash
47
  git clone https://github.com/your-username/background-remover.git
48
  cd background-remover
49
  ```
50
 
51
- 2. Install the required dependencies:
52
-
53
  ```bash
54
  pip install -r requirements.txt
55
  ```
56
 
57
- 3. Run the application:
58
-
59
  ```bash
60
  python app.py
61
  ```
62
- On some systems you may have to run using this command to avoid some issues with pydantic and opencv
63
- ```bash
64
- python app.py --user
65
- ```
66
 
67
- ## Usage
68
 
69
- 1. Upload an image by dragging it into the upload area.
70
- 2. (Optional) Select a background color using the color picker.
71
- 3. Choose a model from the dropdown menu.
72
- 4. Enable or disable alpha matting and post-processing options as needed.
73
- 5. Click "Submit" to remove the background.
74
- 6. View the processed image directly on the page.
75
- 7. Download the processed image by clicking on the download link.
76
 
77
- ## Configuration
78
 
79
- You can customize the project by editing the `app.py` file, which includes the following key options:
 
 
 
80
 
81
- - **Model Selection**: Adjust the models available for users.
82
- - **Alpha Matting**: Modify the parameters for alpha matting.
83
- - **Post-Processing**: Enable or disable post-processing of the mask.
84
 
85
- ## Example
 
 
 
 
86
 
87
- Here's a simple example of how to use the remove function:
88
 
89
  ```python
90
  from PIL import Image
91
- from rembg import remove
 
 
 
 
 
 
 
 
 
 
92
 
93
- input_image = Image.open('input.png')
94
- output_image = remove(input_image, alpha_matting=True, alpha_matting_foreground_threshold=270, alpha_matting_background_threshold=20, alpha_matting_erode_size=11)
 
 
 
 
 
 
95
  output_image.save('output.png')
96
  ```
97
 
98
- ## Contributing
99
 
100
- Contributions are welcome! Please feel free to submit a pull request or open an issue.
 
 
 
 
 
 
101
 
102
- ## License
103
 
104
- This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
105
 
106
- ## Acknowledgments
 
 
 
 
107
 
108
- - [rembg](https://github.com/danielgatis/rembg) - The Python library used for background removal.
109
- - [Gradio](https://www.gradio.app/) - The framework used to create the user interface.
110
 
111
- In case you want to use another free background remover adobe express does something similar. You may have to sign into adobe
112
- https://www.adobe.com/express/feature/image/remove-background/transparent
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
113
 
114
  ---
115
 
 
 
 
 
1
  ---
2
  title: Free Background Remover
3
+ emoji: πŸ–ΌοΈ
4
+ colorFrom: blue
5
+ colorTo: purple
6
  sdk: gradio
7
+ sdk_version: 4.44.1
8
  app_file: app.py
9
  pinned: false
10
  license: apache-2.0
11
+ short_description: Professional background removal tool with multiple AI models - no login required!
12
+ tags: ['computer-vision', 'image-processing', 'rembg', 'background-removal', 'u2net', 'isnet', 'ai-tools']
13
  ---
14
 
15
+ # 🎨 Advanced Background Remover v2.8
16
 
17
+ A powerful, free web-based tool for professional background removal from images. No login required, no watermarks, no paywalls - just upload and download!
18
 
19
+ ## ✨ Features
20
 
21
+ 🎯 **Smart Background Removal** - Advanced AI models for precise edge detection
22
+ 🎨 **Custom Backgrounds** - Replace with solid colors or keep transparent
23
+ πŸ€– **Multiple AI Models** - Choose the best model for your specific use case
24
+ βœ‚οΈ **Alpha Matting** - Enhanced edge quality for professional results
25
+ 🎭 **Specialized Models** - Dedicated models for humans, anime, and clothing
26
+ πŸ“± **Easy to Use** - Simple drag-and-drop interface
27
+ πŸ’Ύ **Instant Download** - Get your processed image immediately
28
 
29
+ ## πŸ€– Available AI Models
 
 
 
 
 
30
 
31
+ | Model | Best For | Size | Quality |
32
+ |-------|----------|------|---------|
33
+ | **u2net** | General use cases (recommended) | Standard | High |
34
+ | **isnet-general-use** | New general model with improved accuracy | Standard | Very High |
35
+ | **isnet-anime** | Anime characters and illustrations | Standard | Excellent |
36
+ | **u2net_human_seg** | Human portraits and people | Standard | Excellent |
37
+ | **u2net_cloth_seg** | Clothing and fashion items | Standard | High |
38
+ | **silueta** | Fast processing (reduced size) | 43MB | Good |
39
+ | **u2netp** | Lightweight, faster processing | Small | Good |
40
+ | **unet** | Basic background removal | Small | Standard |
41
 
42
+ ## πŸš€ Quick Start
43
 
44
+ ### Online Usage (Recommended)
45
+ Visit the [Hugging Face Space](https://huggingface.co/spaces/your-username/free-background-remover) and start removing backgrounds instantly!
 
 
 
 
 
 
46
 
47
+ ### Local Installation
 
 
48
 
49
+ 1. **Clone the repository**
50
  ```bash
51
  git clone https://github.com/your-username/background-remover.git
52
  cd background-remover
53
  ```
54
 
55
+ 2. **Install dependencies**
 
56
  ```bash
57
  pip install -r requirements.txt
58
  ```
59
 
60
+ 3. **Run the application**
 
61
  ```bash
62
  python app.py
63
  ```
 
 
 
 
64
 
65
+ ## πŸ’‘ How to Use
66
 
67
+ 1. **Upload Image** - Drag and drop or click to select your image
68
+ 2. **Choose Options**:
69
+ - 🎨 Select background color (or keep transparent)
70
+ - πŸ€– Pick the best AI model for your image type
71
+ - βš™οΈ Enable advanced options if needed
72
+ 3. **Process** - Click "Submit" and wait a few seconds
73
+ 4. **Download** - Right-click the result to save your image
74
 
75
+ ## βš™οΈ Advanced Options
76
 
77
+ - **🎯 Alpha Matting**: Improves edge quality for hair and fine details
78
+ - **πŸ”§ Post-Process Mask**: Additional refinement of the cutout
79
+ - **πŸ‘οΈ Mask Only**: Export just the selection mask
80
+ - **🎨 Custom Colors**: Any hex color for background replacement
81
 
82
+ ## 🎯 Use Cases
 
 
83
 
84
+ - **E-commerce**: Product photos with clean backgrounds
85
+ - **Social Media**: Profile pictures and content creation
86
+ - **Design Work**: Graphics and marketing materials
87
+ - **Photography**: Portrait enhancement and compositing
88
+ - **Art & Animation**: Character extraction and manipulation
89
 
90
+ ## πŸ”§ API Usage Example
91
 
92
  ```python
93
  from PIL import Image
94
+ from rembg import remove, new_session
95
+
96
+ # Basic usage
97
+ input_image = Image.open('input.jpg')
98
+ output_image = remove(input_image)
99
+ output_image.save('output.png')
100
+
101
+ # Advanced usage with specific model
102
+ session = new_session('u2net_human_seg')
103
+ output_image = remove(input_image, session=session)
104
+ output_image.save('output.png')
105
 
106
+ # With alpha matting for better quality
107
+ output_image = remove(
108
+ input_image,
109
+ alpha_matting=True,
110
+ alpha_matting_foreground_threshold=270,
111
+ alpha_matting_background_threshold=20,
112
+ alpha_matting_erode_size=11
113
+ )
114
  output_image.save('output.png')
115
  ```
116
 
117
+ ## πŸ“Š Model Performance
118
 
119
+ | Model | Speed | Quality | Best For |
120
+ |-------|-------|---------|----------|
121
+ | silueta | ⚑⚑⚑ | ⭐⭐⭐ | Quick processing |
122
+ | u2netp | ⚑⚑ | ⭐⭐⭐⭐ | Balanced |
123
+ | u2net | ⚑ | ⭐⭐⭐⭐⭐ | High quality |
124
+ | isnet-general-use | ⚑ | ⭐⭐⭐⭐⭐ | Best overall |
125
+ | isnet-anime | ⚑ | ⭐⭐⭐⭐⭐ | Anime/illustrations |
126
 
127
+ ## 🀝 Contributing
128
 
129
+ Contributions are welcome! Here's how you can help:
130
 
131
+ - πŸ› Report bugs and issues
132
+ - πŸ’‘ Suggest new features
133
+ - πŸ”§ Submit pull requests
134
+ - πŸ“– Improve documentation
135
+ - ⭐ Star the repository if you find it useful!
136
 
137
+ ## πŸ“ Requirements
 
138
 
139
+ ```
140
+ gradio>=4.44.1
141
+ rembg>=2.0.50
142
+ Pillow>=10.0.0
143
+ numpy>=1.24.0
144
+ ```
145
+
146
+ ## πŸ”— Alternative Tools
147
+
148
+ If you need more features, consider these alternatives:
149
+ - [Adobe Express Background Remover](https://www.adobe.com/express/feature/image/remove-background/transparent) (requires Adobe account)
150
+ - [Remove.bg](https://www.remove.bg/) (limited free usage)
151
+
152
+ ## πŸ“„ License
153
+
154
+ This project is licensed under the Apache License 2.0 - see the [LICENSE](LICENSE) file for details.
155
+
156
+ ## πŸ™ Acknowledgments
157
+
158
+ - **[rembg](https://github.com/danielgatis/rembg)** - The powerful Python library powering the background removal
159
+ - **[Gradio](https://www.gradio.app/)** - The framework making this tool accessible to everyone
160
+ - **[Hugging Face](https://huggingface.co/)** - For hosting this free tool
161
 
162
  ---
163
 
164
+ ⭐ **Star this repository if you find it useful!** ⭐
165
+
166
+ Made with ❀️ for the open-source community