Skip to content

yolov8模型训练好以后直接调用Ultralytics中的YOLO进行推理是怎么把图像缩放到训练时的图像大小的,这个参数被保存在哪里? #14029

Discussion options

You must be logged in to vote

@yangyang-03120100 hello!

Great question! When you train a YOLOv8 model, the image size used during training is indeed an important parameter. This parameter is stored within the model's configuration and is automatically utilized during inference to ensure consistency.

Here's how it works:

  1. Training Configuration: During training, you specify the image size using the imgsz parameter. This parameter is saved in the model's configuration file.

  2. Inference: When you load the trained model for inference using YOLO("path/to/your_model.pt"), the model retains the image size used during training. This ensures that the input images are resized to the same dimensions as during training.

For ex…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by glenn-jocher
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants