hamhanry / YOLOv10-OBB

24 stars 5 forks source link

train and source code #4

Open keruoya opened 3 months ago

keruoya commented 3 months ago

Hi ! Thank you for your excellent work ! I want to ask that would you publish source code? I want to train on my own datasets,thank you very much !

hamhanry commented 2 months ago

hi @keruoya
the training code were based on the ultralytics version. (pleaes check the environment that i put in this repo) as long as you follow the requirement and my snippet code, you could just train directly.

keruoya commented 2 months ago

hi @keruoya the training code were based on the ultralytics version. (pleaes check the environment that i put in this repo) as long as you follow the requirement and my snippet code, you could just train directly.

but I can't find yolov10-obb.yaml in ultraytics , and I still don't kown how to start to train yolov10-obb ,could you give more details ? Thank you very much !!!

54HaoHao-hue commented 2 months ago

@keruoya hi, there is no yolov10-obb.yaml in ultraytics,there is only yolov10(b/m/n/x.....).yaml, did you change the yolov10(b/m/n/x.....).yaml to yolov10-obb.yaml? could you give more details ? Thank you very much !

hamhanry commented 2 months ago

@keruoya @54HaoHao-hue in order to use this model for pretrained you do not need the yaml. You could just directly follow the snippet, the ultralytics will remember the config its self.

the training its self, you needs to provide the yaml of annotated bbox that is support by this obb, check more details here

# Load a model
model = YOLO(
    "path_to_your_checkpoint", 
    task="obb",
)

# Train the model
results = model.train(
    data="yaml_path_for_obb_annotated_data",
    epochs=100,
    imgsz=1024,
    batch=2,
    device="0",
)
Alexsade commented 1 month ago

@hamhanry Hello sir, I followed your way but I have an errors:


UnpicklingError Traceback (most recent call last) in <cell line: 4>() 2 from ultralytics import YOLO 3 ----> 4 model = YOLO( 5 "/content/drive/MyDrive/Obb-YOLOv10-Surgical-Tool/train/weights/yolov10n-obb.pt", 6 task="obb",

7 frames /usr/local/lib/python3.10/dist-packages/torch/serialization.py in _legacy_load(f, map_location, pickle_module, pickle_load_args) 1336 "functionality.") 1337 -> 1338 magic_number = pickle_module.load(f, pickle_load_args) 1339 if magic_number != MAGIC_NUMBER: 1340 raise RuntimeError("Invalid magic number; corrupt file?")

UnpicklingError: invalid load key, '<'.

My model is an access link to the YOLOv10-N-OBB file, which is a file in .pt format, not like .yaml. I copied the link in your github. Can you show me how to resolve this error?

Thank you very much