File size: 498 Bytes
046b3c9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import numpy as np
from huggingface_hub import hf_hub_url, cached_download
import joblib

REPO_ID = "MalchuL/JJBAGAN"
FILENAME = "198_jjba_8_k_2_099_ep.onnx"

model = cached_download(
    hf_hub_url(REPO_ID, FILENAME)
)
print(model)

import onnxruntime
ort_session = onnxruntime.InferenceSession(str(model))
input_name = ort_session.get_inputs()[0].name
ort_inputs = {input_name: np.random.randn(1, 3, 256, 256).astype(dtype=np.float32)}
ort_outs = ort_session.run(None, ort_inputs)
print(ort_outs)