README and gitgnore
This commit is contained in:
+14
-1
@@ -1 +1,14 @@
|
|||||||
/__pycache__/
|
# Byte-compiled / optimized / DLL files
|
||||||
|
/__pycache__/
|
||||||
|
*.py[cod]
|
||||||
|
*.pyo
|
||||||
|
|
||||||
|
# Virtual environment
|
||||||
|
/venv/
|
||||||
|
|
||||||
|
# Images and outputs
|
||||||
|
/images/
|
||||||
|
/outputs/
|
||||||
|
|
||||||
|
# Configuration file
|
||||||
|
conf.py
|
||||||
@@ -1,25 +1,65 @@
|
|||||||
See the `conf.py`:
|
# Image Processing with YOLO and Inpainting
|
||||||
```
|
|
||||||
scheme = 'A'
|
This project provides a framework for removing people from images using YOLO for object detection and OpenCV or LaMa for inpainting. You can configure the behavior of the program by editing the `conf.py` file.
|
||||||
|
|
||||||
|
## Configuration
|
||||||
|
|
||||||
|
Edit the `conf.py` file to select the processing scheme and customize its parameters:
|
||||||
|
|
||||||
|
```python
|
||||||
|
scheme = 'A' # Choose 'A' or 'B'
|
||||||
|
|
||||||
schemeA = {
|
schemeA = {
|
||||||
'image_name': 'd1.jpg',
|
'image_name': 'd1.jpg', # Input image name
|
||||||
'is_lama': False,
|
'is_lama': False, # Use LaMa for inpainting (True/False)
|
||||||
'inpaint_radius': 3,
|
'inpaint_radius': 3, # Radius for OpenCV inpainting
|
||||||
'is_gaussianblur': True,
|
'is_gaussianblur': True, # Apply Gaussian blur to the mask
|
||||||
'gaussian_radius': 9 # Odd number
|
'gaussian_radius': 9 # Gaussian blur radius (odd number)
|
||||||
}
|
}
|
||||||
|
|
||||||
schemeB = {
|
schemeB = {
|
||||||
'image_name': 'd1.jpg',
|
'image_name': 'd1.jpg', # Input image name
|
||||||
'gaussian_radius': 51, # Odd number
|
'gaussian_radius': 51, # Gaussian blur radius (odd number)
|
||||||
'is_use_fill_color': False,
|
'is_use_fill_color': False, # Use a fill color for blending
|
||||||
'fill_color': [227, 234, 244]
|
'fill_color': [227, 234, 244] # RGB fill color
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
You can choose scheme whcih you want.<br>
|
|
||||||
The A is useof openCV inpaint or model(LaMa); And B is useof openCV but no inpaint.<br>
|
- **Scheme A**: Uses OpenCV or LaMa for inpainting.
|
||||||
When you finished the conf, run `python main.py`.<br>
|
- **Scheme B**: Uses OpenCV for blending without inpainting.
|
||||||
<br>
|
|
||||||
If you have a better scheme, please connect me.<br>
|
## How to Run
|
||||||
Email: xiadongliang88@163.com<br>
|
|
||||||
|
1. Install the required dependencies:
|
||||||
|
```bash
|
||||||
|
pip install -r requirements.txt
|
||||||
|
```
|
||||||
|
|
||||||
|
2. Configure the `conf.py` file to select the desired scheme and parameters.
|
||||||
|
|
||||||
|
3. Run the main script:
|
||||||
|
```bash
|
||||||
|
python main.py
|
||||||
|
```
|
||||||
|
|
||||||
|
## Outputs
|
||||||
|
|
||||||
|
Processed images will be saved in the `outputs/` directory with filenames indicating the scheme and input image.
|
||||||
|
|
||||||
|
## Directory Structure
|
||||||
|
|
||||||
|
```
|
||||||
|
├── images/ # Input images
|
||||||
|
├── outputs/ # Processed images
|
||||||
|
├── conf.py # Configuration file
|
||||||
|
├── main.py # Main script
|
||||||
|
├── schemeA.py # Scheme A implementation
|
||||||
|
├── schemeB.py # Scheme B implementation
|
||||||
|
├── requirements.txt # Python dependencies
|
||||||
|
```
|
||||||
|
|
||||||
|
## Contact
|
||||||
|
|
||||||
|
If you have suggestions for improving this project or new schemes to add, feel free to contact me:
|
||||||
|
|
||||||
|
**Email**: xiadongliang88@163.com
|
||||||
Reference in New Issue
Block a user