A Python tool for detecting cars in images and removing their backgrounds. This tool uses YOLOv8 for car detection and rembg for background removal.
- Car detection using YOLOv8
- Background removal using rembg
- Support for multiple image formats (JPG, JPEG, PNG)
- Automatic gradient background generation
- Batch processing of multiple images
- Clone the repository:
git clone https://github.com/yourusername/car_image_cleaner.git
cd car_image_cleaner- Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install dependencies:
pip install -r requirements.txt- Place your images in the
inputdirectory - Run the script:
python src/image_cleaner.py- Find the processed images in the
outputdirectory
car_image_cleaner/
├── input/ # Input images directory
├── output/ # Output images directory
├── src/ # Source code
│ ├── image_cleaner.py # Main implementation
│ └── v2/ # Version 2 (in development)
├── tests/ # Test files
├── requirements.txt # Project dependencies
└── README.md # This file
- opencv-python>=4.8.1
- ultralytics>=8.0.0
- rembg>=2.0.0
- numpy>=1.24.0
- pillow>=10.0.0
- pytest>=7.4.0
- black>=23.7.0
- flake8>=6.1.0
- python-dotenv>=1.0.0
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- YOLOv8 for car detection
- rembg for background removal
- OpenCV for image processing