pesi
/

Luigi commited on
Commit
57a8c6b
1 Parent(s): 35b2a45

Use ONNXruntime instead of ONNX.checker.check_model to detect ONNX model

Browse files
Files changed (1) hide show
  1. rtmo_gpu.py +2 -3
rtmo_gpu.py CHANGED
@@ -239,11 +239,10 @@ def draw_skeleton(img,
239
 
240
  def is_onnx_model(model_path):
241
  try:
242
- import onnx
243
- onnx_model = onnx.load(model_path)
244
- onnx.checker.check_model(onnx_model)
245
  return True
246
  except Exception as e:
 
247
  return False
248
 
249
  def is_trt_engine(model_path):
 
239
 
240
  def is_onnx_model(model_path):
241
  try:
242
+ ort.InferenceSession(model_path, providers=["CPUExecutionProvider"])
 
 
243
  return True
244
  except Exception as e:
245
+ print('Error:', type(e))
246
  return False
247
 
248
  def is_trt_engine(model_path):