Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -335,11 +335,11 @@ def main(image_bgr, backbone_choice, box_model = torchvision.models.detection.fa
|
|
335 |
box_model.to(CTX)
|
336 |
box_model.eval()
|
337 |
|
338 |
-
if backbone_choice == "
|
339 |
-
backbone_choice = "tph_a4_256x192"
|
340 |
-
else:
|
341 |
-
backbone_choice == "ResNet"
|
342 |
backbone_choice = "tpr_a4_256x192"
|
|
|
|
|
|
|
343 |
model = torch.hub.load('yangsenius/TransPose:main', backbone_choice , pretrained=True)
|
344 |
|
345 |
img_dimensions = (256, 192)
|
@@ -364,10 +364,10 @@ def main(image_bgr, backbone_choice, box_model = torchvision.models.detection.fa
|
|
364 |
return image_bgr
|
365 |
|
366 |
title = "TransPose"
|
367 |
-
description = "Gradio demo for TransPose: Keypoint localization via Transformer. Dataset: COCO train2017 & COCO val2017."
|
368 |
article = "<div style='text-align: center;'><a href='https://github.com/yangsenius/TransPose' target='_blank'>Full credits: github.com/yangsenius/TransPose</a></div>"
|
369 |
|
370 |
-
examples = [["./examples/one.jpg"], ["./examples/two.jpg"]]
|
371 |
|
372 |
iface = gr.Interface(main, inputs=[gr.inputs.Image(), gr.inputs.Radio(["HRNet", "ResNet"])], outputs="image", description=description, article=article, title=title, examples=examples)
|
373 |
iface.launch(enable_queue=True, debug='True')
|
|
|
335 |
box_model.to(CTX)
|
336 |
box_model.eval()
|
337 |
|
338 |
+
if backbone_choice == "ResNet":
|
|
|
|
|
|
|
339 |
backbone_choice = "tpr_a4_256x192"
|
340 |
+
else:
|
341 |
+
backbone_choice == "HRNet"
|
342 |
+
backbone_choice = "tph_a4_256x192"
|
343 |
model = torch.hub.load('yangsenius/TransPose:main', backbone_choice , pretrained=True)
|
344 |
|
345 |
img_dimensions = (256, 192)
|
|
|
364 |
return image_bgr
|
365 |
|
366 |
title = "TransPose"
|
367 |
+
description = "Gradio demo for TransPose: Keypoint localization via Transformer. Dataset: COCO train2017 & COCO val2017. Default backbone selection = HRNet"
|
368 |
article = "<div style='text-align: center;'><a href='https://github.com/yangsenius/TransPose' target='_blank'>Full credits: github.com/yangsenius/TransPose</a></div>"
|
369 |
|
370 |
+
examples = [["./examples/one.jpg", "HRNet"], ["./examples/two.jpg", "HRNet"]]
|
371 |
|
372 |
iface = gr.Interface(main, inputs=[gr.inputs.Image(), gr.inputs.Radio(["HRNet", "ResNet"])], outputs="image", description=description, article=article, title=title, examples=examples)
|
373 |
iface.launch(enable_queue=True, debug='True')
|