Initial commit for push folder
This commit is contained in:
commit
c4af9fcbb5
82 changed files with 3294 additions and 0 deletions
32
recognization/code/train.py
Normal file
32
recognization/code/train.py
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
from ultralytics import YOLO
|
||||
|
||||
# Load a model
|
||||
model = YOLO("yolo26n.pt") # load a pretrained model (recommended for training)
|
||||
EPOCHS = 10
|
||||
IMG_SIZE = 640
|
||||
BATCH_SIZE = 8
|
||||
WORKERS = 2
|
||||
PATIENCE = 5
|
||||
SEED = 42
|
||||
# Train the model
|
||||
results = model.train(data="/Users/nguyenhongvan/recongnize/data/SKU/data_kaggle.yaml", epochs=EPOCHS,
|
||||
imgsz=IMG_SIZE,
|
||||
|
||||
batch=BATCH_SIZE,
|
||||
|
||||
workers=WORKERS,
|
||||
|
||||
patience=PATIENCE,
|
||||
|
||||
cache=True,
|
||||
|
||||
amp=True,
|
||||
|
||||
cos_lr=True,
|
||||
|
||||
optimizer="AdamW",
|
||||
|
||||
seed=SEED,
|
||||
|
||||
exist_ok=True
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue