Browse Source

PyTorch Hub and autoShape update (#1415)

5.0
Glenn Jocher 4 years ago
parent
commit
311de00855
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      hubconf.py

+ 2
- 1
hubconf.py View File

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()

Loading…
Cancel
Save