1. Simply type commands like a yolov5 and add "--mosaic-img" as follows:
$ python detect.py --source aaa/bbb.mp4 --mosaic-img
$ # if you want to make mosaic for specific class (ex. person)
$ python detect.py --source aaa/bbb.mp4 --mosaic-img--classes 0
1. Create label using yolov5 as follows:
$ python detect.py --source aaa/bbb.mp4 --save-txt --classes 0
2. Put original movie and label file
mosaic_yolov5
└─data
├─labels
└─original_movie
└─bbb.mp4
3. Change mp4 file name in mosac.py
[9] video_path = "./data/original_movie/bbb.mp4" # bbb is your mp4 file name
4. Create mosaic movie
$ python mosaic.py