-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4eaa351
commit b51ad85
Showing
1 changed file
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
from ultralytics import YOLO | ||
import matplotlib | ||
matplotlib.use('TKAgg') | ||
import matplotlib.pyplot as plt | ||
|
||
|
||
########################### | ||
## MODEL LOAD | ||
########################## | ||
# Load a model | ||
model = YOLO("yolov8l.yaml") # build a new model from scratch | ||
###model = YOLO("runs/detect/train/weights/last.pt") # build a new model from scratch | ||
|
||
########################## | ||
## TRAIN MODEL | ||
########################## | ||
# Use the model | ||
dataset= "dataset.yaml" | ||
|
||
model.train( | ||
data=dataset, | ||
epochs=300, | ||
##resume=True, | ||
##batch=-1, | ||
batch=16, | ||
imgsz=640, | ||
device=[0,1,2,3], | ||
workers=4, | ||
pretrained=False, | ||
optimizer='auto', | ||
val=True, | ||
plots=True, | ||
## AUGMENTATION OPTIONS | ||
erasing=0, | ||
mosaic=0, | ||
hsv_h=0, | ||
hsv_s=0, | ||
hsv_v=0, | ||
translate=0, | ||
degrees=180, #random rotation-180 180 | ||
flipud=0.5, # random lr flipping | ||
fliplr=0.5, # random lr flipping | ||
scale=0.89, #scaling between 400x400, 850*850 | ||
crop_fraction=1.0, #random cropping, bounds not specified in paper | ||
) # train the model | ||
|