TorchViTDetPredictor parse input error
Cathy0908 opened this issue · 0 comments
Cathy0908 commented
When i use TorchViTDetPredictor
to predict my images, the inputs cannot be parsed.
I tried two input formats.
Format 1: inputs is np.ndarray:
Raise KeyError: 'LoadImageFromWebcam is not in the pipeline registry'
Format 1: inputs is local file path:
Raise ValueError: unknown url type: '/000000037777.jpg'
My full code is as follows:
import os
import numpy as np
from PIL import Image
from easycv.predictors.detector import TorchViTDetPredictor
model_path='./vitdet_maskrcnn.pt'
predictor = TorchViTDetPredictor(model_path = model_path)
img = './000000037777.jpg'
# format 1
input_data_list = [img]
# format 2
input_data_list = [np.asarray(Image.open(img))]
output_list = predictor.predict(input_data_list)
print(output_list)