|
|
|
|
|
|
|
|
from pathlib import Path |
|
|
from pathlib import Path |
|
|
|
|
|
|
|
|
import torch |
|
|
import torch |
|
|
from PIL import Image |
|
|
|
|
|
|
|
|
|
|
|
from models.yolo import Model |
|
|
from models.yolo import Model |
|
|
from utils.general import set_logging |
|
|
from utils.general import set_logging |
|
|
|
|
|
|
|
|
model = model.fuse().autoshape() # for PIL/cv2/np inputs and NMS |
|
|
model = model.fuse().autoshape() # for PIL/cv2/np inputs and NMS |
|
|
|
|
|
|
|
|
# Verify inference |
|
|
# Verify inference |
|
|
|
|
|
from PIL import Image |
|
|
|
|
|
|
|
|
imgs = [Image.open(x) for x in Path('data/images').glob('*.jpg')] |
|
|
imgs = [Image.open(x) for x in Path('data/images').glob('*.jpg')] |
|
|
results = model(imgs) |
|
|
results = model(imgs) |
|
|
results.show() |
|
|
results.show() |