Closed johan-irreverentlabs closed 2 months ago
You can use the PyTorch model in your project. You can find a simple code example in the predict.py
file. I recently tested the model by creating a new project, and it works as expected. Install dependencies pip install ultralytics
and run the code:
from ultralytics import YOLO
from PIL import Image
model = YOLO('yolov8m-face-lindevs.pt')
results = model.predict(
'https://raw.githubusercontent.com/lindevs/yolov8-face/master/data/images/bus.jpg',
imgsz=640,
conf=0.75,
iou=0.7,
device='cpu',
verbose=False
)
img = results[0].plot()
img = Image.fromarray(img[..., ::-1])
img.show()
Thanks!
I'm trying to load the Pytorch model:
I'm getting the following error:
It seems to assume something about my directory structure. I did not clone this repository. I'm just trying to reuse the model in my own project. Can I specify a different path for this file?