Skip to content

mmoollllee/yolov7-object-blurring

 
 

Repository files navigation

yolov7-object-blurring

Steps to run Code

  • Clone the repository.
git clone [email protected]:mmoollllee/yolov7-object-blurring.git
  • Goto the cloned folder.
cd yolov7-object-blurring
  • Create a virtual envirnoment (optional & recommended, If you dont want to disturb python packages)
### For Linux Users
python3 -m venv yolov7objblurring
source yolov7objblurring/bin/activate

### For Window Users
python3 -m venv yolov7objblurring
cd yolov7objblurring
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 object detection weights from link and move them to the working directory {yolov7-object-blurring}
  • Create a config.txt to set default parameters
[Main]
source = ../webcam
img_size = 3264
conf_thres = 0.1
blurratio = 10
delete = true
hidedetarea = true
rotate = 90
  • Run the code with mentioned command below.
#if you want to change source file
python detect_and_blur.py --weights yolov7.pt --source "input/folder" --blurratio 20

#for specific classes
python detect_and_blur.py --weights yolov7.pt --source "your video.mp4" --classes 0  --blurratio 50

#hide-detected-bounding-boxes
python detect_and_blur.py --weights yolov7.pt --source "your video.mp4" --classes 0 --blurratio 50 --hidedetarea
  • Output file will be created in the working-dir/runs/detect/exp with original filename.

References

My Medium Articles

For more details, you can reach out to me on Medium or can connect with me on LinkedIn

About

YOLOv7 Object Blurring Using PyTorch and OpenCV

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 90.3%
  • Jupyter Notebook 9.7%