# -*- coding: utf-8 -*-
"""Untitled10.ipynb

Automatically generated by Colab.

Original file is located at
    https://colab.research.google.com/drive/1yOiAbo22Ia7ut1ntayj1F8WocpzzhLUF
"""

!pip install ultralytics

!pip install roboflow

from roboflow import Roboflow
rf = Roboflow(api_key="35h7JcvLtPbvlDAkCtZg")
project = rf.workspace("tomas-6mrdn").project("tai-lung-v2")
version = project.version(3)
dataset = version.download("yolov8")

from ultralytics import YOLO

# Initialize the model
model = YOLO("yolov8s.pt")

# Train the model with more epochs
results = model.train(data="/content/Tai-Lung-V2-3/data.yaml", epochs=150, imgsz=640)  # Increase epochs for better learning

# Note: The above code will not include early stopping or learning rate scheduling.
# You will need to monitor the training process manually or implement custom callbacks if supported by the library.