dylanplummer commited on
Commit
4e386bd
·
1 Parent(s): 34410cd

test fp16

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -25,8 +25,8 @@ from hls_download import download_clips
25
 
26
  plt.style.use('dark_background')
27
 
28
- onnx_file = hf_hub_download(repo_id="dylanplummer/ropenet", filename="nextjump.onnx", repo_type="model", token=os.environ['DATASET_SECRET'])
29
- #onnx_file = hf_hub_download(repo_id="dylanplummer/ropenet", filename="nextjump_fp16.onnx", repo_type="model", token=os.environ['DATASET_SECRET'])
30
  # model_xml = hf_hub_download(repo_id="dylanplummer/ropenet", filename="model.xml", repo_type="model", token=os.environ['DATASET_SECRET'])
31
  # hf_hub_download(repo_id="dylanplummer/ropenet", filename="model.mapping", repo_type="model", token=os.environ['DATASET_SECRET'])
32
  #model_xml = "model_ir/model.xml"
@@ -134,7 +134,7 @@ def inference(stream_url, start_time, end_time, count_only_api, api_key,
134
  print('Running inference...')
135
  if len(batch_list) == batch_size:
136
  batch_X = torch.cat(batch_list)
137
- outputs = ort_sess.run(None, {'video': batch_X.numpy()})
138
  y1pred = outputs[0]
139
  y2pred = outputs[1]
140
  y3pred = outputs[2]
@@ -158,7 +158,7 @@ def inference(stream_url, start_time, end_time, count_only_api, api_key,
158
  batch_list.append(batch_list[-1])
159
  idx_list.append(idx_list[-1])
160
  batch_X = torch.cat(batch_list)
161
- outputs = ort_sess.run(None, {'video': batch_X.numpy()})
162
  y1pred = outputs[0]
163
  y2pred = outputs[1]
164
  y3pred = outputs[2]
 
25
 
26
  plt.style.use('dark_background')
27
 
28
+ #onnx_file = hf_hub_download(repo_id="dylanplummer/ropenet", filename="nextjump.onnx", repo_type="model", token=os.environ['DATASET_SECRET'])
29
+ onnx_file = hf_hub_download(repo_id="dylanplummer/ropenet", filename="nextjump_fp16.onnx", repo_type="model", token=os.environ['DATASET_SECRET'])
30
  # model_xml = hf_hub_download(repo_id="dylanplummer/ropenet", filename="model.xml", repo_type="model", token=os.environ['DATASET_SECRET'])
31
  # hf_hub_download(repo_id="dylanplummer/ropenet", filename="model.mapping", repo_type="model", token=os.environ['DATASET_SECRET'])
32
  #model_xml = "model_ir/model.xml"
 
134
  print('Running inference...')
135
  if len(batch_list) == batch_size:
136
  batch_X = torch.cat(batch_list)
137
+ outputs = ort_sess.run(None, {'video': np.float16(batch_X.numpy())})
138
  y1pred = outputs[0]
139
  y2pred = outputs[1]
140
  y3pred = outputs[2]
 
158
  batch_list.append(batch_list[-1])
159
  idx_list.append(idx_list[-1])
160
  batch_X = torch.cat(batch_list)
161
+ outputs = ort_sess.run(None, {'video': np.float16(batch_X.numpy())})
162
  y1pred = outputs[0]
163
  y2pred = outputs[1]
164
  y3pred = outputs[2]