# Paths
image_folder = Path(r'Jnx03\DSC07001-9000') #Image you want to label
label_folder = Path(r'Jnx03\label') #Save Label folder
# Model
model = torch.load('best.pt', map_location=device)['model'].float() #Change Best.pt to you pre-train model
-
Install PyTorch and other dependencies:
pip install torch torchvision pillow numpy
-
Download and set up YOLOv7:
git clone https://github.com/WongKinYiu/yolov7 cd yolov7
-
Place
best.pt
in the YOLOv7 directory. -
Run the script: Save the script above in a Python file, for example
auto_label.py
, and run it:python AutoLabel.py