Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

https://github.com/RizwanMunawar/yolov7-object-cropping

YOLOv7 Object Cropping Using OpenCV
https://github.com/RizwanMunawar/yolov7-object-cropping

computer-vision crop-image deep-learning opencv-python yolov7

Last synced: 12 days ago
JSON representation

YOLOv7 Object Cropping Using OpenCV

Lists

README

        

# yolov7-object-cropping

### Steps to run Code
- Clone the repository.
```
git clone https://github.com/RizwanMunawar/yolov7-object-cropping.git
```
- Goto the cloned folder.
```
cd yolov7-object-cropping
```
- Create a virtual envirnoment (Recommended, If you dont want to disturb python packages)
```
### For Linux Users
python3 -m venv yolov7objcropping
source yolov7objcropping/bin/activate

### For Window Users
python3 -m venv yolov7objcropping
cd yolov7objcropping
cd Scripts
activate
cd ..
cd ..
```
- Upgrade pip with mentioned command below.
```
pip install --upgrade pip
```
- Install requirements with mentioned command below.
```
pip install -r requirements.txt
```
- Download [yolov7](https://github.com/WongKinYiu/yolov7/releases/download/v0.1/yolov7.pt) object detection weights from link and move them to the working directory {yolov7-object-cropping}
- Run the code with mentioned command below.
```
#if you want to change source file
python detect_and_crop.py --weights yolov7.pt --source "your video.mp4"

#for specific class (person)
python detect_and_crop.py --weights yolov7.pt --source "your video.mp4" -classes 0
```
- Cropped Objects will be stored in "working-dir/crop" folder.

### Results


Objects Cropped 1
Objects Cropped 2
Objects Cropped 3
Objects Cropped 4
Objects Cropped 5
Objects Cropped 6
Objects Cropped 7










### References
- https://github.com/WongKinYiu/yolov7
- https://opencv.org/

### My Medium Articles
- https://medium.com/augmented-startups/yolov7-training-on-custom-data-b86d23e6623
- https://medium.com/augmented-startups/roadmap-for-computer-vision-engineer-45167b94518c
- https://medium.com/augmented-startups/yolor-or-yolov5-which-one-is-better-2f844d35e1a1
- https://medium.com/augmented-startups/train-yolor-on-custom-data-f129391bd3d6
- https://medium.com/augmented-startups/develop-an-analytics-dashboard-using-streamlit-e6282fa5e0f

For more details, you can reach out to me on [Medium](https://chr043416.medium.com/) or can connect with me on [LinkedIn](https://www.linkedin.com/in/muhammadrizwanmunawar/)