Spaces:
Runtime error
Runtime error
Update gradio_utils/utils.py
Browse files- gradio_utils/utils.py +3 -3
gradio_utils/utils.py
CHANGED
|
@@ -201,8 +201,8 @@ def process(query_img, state,
|
|
| 201 |
wrap_fp16_model(model)
|
| 202 |
load_checkpoint(model, checkpoint_path, map_location='cpu')
|
| 203 |
|
| 204 |
-
|
| 205 |
-
|
| 206 |
data['target_weight_s'][0] = data['target_weight_s'][0].cpu().numpy().tolist()
|
| 207 |
data['target_s'][0] = data['target_s'][0].cpu().numpy().tolist()
|
| 208 |
|
|
@@ -212,7 +212,7 @@ def process(query_img, state,
|
|
| 212 |
data['img_metas'][0]['query_center'] = data['img_metas'][0]['query_center'].cpu().tolist()
|
| 213 |
data['img_metas'][0]['sample_scale'][0] = data['img_metas'][0]['sample_scale'][0].cpu().tolist()
|
| 214 |
data['img_metas'][0]['query_scale'] = data['img_metas'][0]['query_scale'].cpu().tolist()
|
| 215 |
-
|
| 216 |
model.eval()
|
| 217 |
|
| 218 |
str_data = json.dumps(data, cls=CustomEncoder)
|
|
|
|
| 201 |
wrap_fp16_model(model)
|
| 202 |
load_checkpoint(model, checkpoint_path, map_location='cpu')
|
| 203 |
|
| 204 |
+
data["img_s"] = data["img_s"][0].cpu().numpy().tolist()
|
| 205 |
+
data["img_q"] = data["img_q"].cpu().numpy().tolist()
|
| 206 |
data['target_weight_s'][0] = data['target_weight_s'][0].cpu().numpy().tolist()
|
| 207 |
data['target_s'][0] = data['target_s'][0].cpu().numpy().tolist()
|
| 208 |
|
|
|
|
| 212 |
data['img_metas'][0]['query_center'] = data['img_metas'][0]['query_center'].cpu().tolist()
|
| 213 |
data['img_metas'][0]['sample_scale'][0] = data['img_metas'][0]['sample_scale'][0].cpu().tolist()
|
| 214 |
data['img_metas'][0]['query_scale'] = data['img_metas'][0]['query_scale'].cpu().tolist()
|
| 215 |
+
|
| 216 |
model.eval()
|
| 217 |
|
| 218 |
str_data = json.dumps(data, cls=CustomEncoder)
|