tanthinhdt commited on
Commit
175bb4b
·
verified ·
1 Parent(s): 8b82636

fix(app): rectify errors in inference function

Browse files
Files changed (1) hide show
  1. app.py +9 -13
app.py CHANGED
@@ -73,7 +73,7 @@ def inference(
73
  model_input_width: int,
74
  device: str,
75
  transform: Compose,
76
- progress: gr.Progress,
77
  ) -> tuple:
78
  progress(0, desc='Preprocessing video')
79
  inputs = preprocess(
@@ -131,18 +131,6 @@ if __name__ == '__main__':
131
  ]
132
  )
133
 
134
- inference(
135
- model=model,
136
- keypoints_detector=keypoints_detector,
137
- source=config['inference']['source'],
138
- data_height=config['data']['height'],
139
- data_width=config['data']['width'],
140
- model_input_height=height,
141
- model_input_width=width,
142
- device=device,
143
- transform=transform,
144
- )
145
-
146
  iface = gr.Interface(
147
  fn=inference,
148
  inputs=[
@@ -155,6 +143,14 @@ if __name__ == '__main__':
155
  label='k',
156
  info='Return top-k results',
157
  ),
 
 
 
 
 
 
 
 
158
  ],
159
  outputs='text',
160
  examples=examples,
 
73
  model_input_width: int,
74
  device: str,
75
  transform: Compose,
76
+ progress: gr.Progress = gr.Progress(),
77
  ) -> tuple:
78
  progress(0, desc='Preprocessing video')
79
  inputs = preprocess(
 
131
  ]
132
  )
133
 
 
 
 
 
 
 
 
 
 
 
 
 
134
  iface = gr.Interface(
135
  fn=inference,
136
  inputs=[
 
143
  label='k',
144
  info='Return top-k results',
145
  ),
146
+ model,
147
+ keypoints_detector,
148
+ config['data']['height'],
149
+ config['data']['width'],
150
+ height,
151
+ width,
152
+ device,
153
+ transform,
154
  ],
155
  outputs='text',
156
  examples=examples,