0

"How to hide labels and probability in YOLOv8 while saving predictions?"

from ultralytics import YOLO
from pathlib import Path

model = YOLO("yolov8m-seg.pt")

results = model.train(
data="D:/a)tutot_seg/YOLO_dataset/data.yaml",
epochs=3,
imgsz=1280,
batch=1
)

image_folder = Path("D:/A)seg23/COCO_to_YOLOv8/YOLO_dataset/validation/images")
image_paths = list(image_folder.glob("\*.jpg"))

results = model.predict(source=image_paths, verbose=False)

output_folder = Path("D:/A)seg23/COCO_to_YOLOv8/YOLO_dataset/predictions")
output_folder.mkdir(parents=True, exist_ok=True)

for i, result in enumerate(results):
annotated_image = result.plot(labels=False, conf=False)  # Убираем метки и вероятность
output_path = output_folder / f"pred\_{i}.jpg"
result.save(output_path)  # Сохраняем обработанное изображение

print("Предсказания сохранены в:", output_folder)

help with the label and sant remove this

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.