Spaces:
Running
Running
Commit
·
5fdb397
1
Parent(s):
8f8e463
Clean code
Browse files- .gitignore +3 -1
- app.py +2 -36
- config/config.yaml +1 -0
.gitignore
CHANGED
|
@@ -1,3 +1,5 @@
|
|
| 1 |
*.pyc
|
| 2 |
demo_out
|
| 3 |
-
logs/
|
|
|
|
|
|
|
|
|
| 1 |
*.pyc
|
| 2 |
demo_out
|
| 3 |
+
logs/
|
| 4 |
+
.vscode
|
| 5 |
+
checkpoints
|
app.py
CHANGED
|
@@ -109,39 +109,6 @@ def inference(img: Dict)-> Tuple[Union[np.ndarray|None], List[str]]:
|
|
| 109 |
return (None, [])
|
| 110 |
|
| 111 |
|
| 112 |
-
# with gr.Blocks(title="AniMer", css=".gradio-container") as demo:
|
| 113 |
-
|
| 114 |
-
# gr.HTML("""<div style="font-weight:bold; text-align:center; color:royalblue;">AniMer</div>""")
|
| 115 |
-
|
| 116 |
-
# with gr.Row():
|
| 117 |
-
# with gr.Column():
|
| 118 |
-
# input_image = gr.ImageEditor(label="Input image", sources=["upload", "clipboard"],
|
| 119 |
-
# brush=False, eraser=False, layers=False, transforms="crop",
|
| 120 |
-
# interactive=True,
|
| 121 |
-
# )
|
| 122 |
-
# crop_image = gr.Image(label="Crop image", sources=[])
|
| 123 |
-
# input_image.change(predict, outputs=crop_image, inputs=input_image, show_progress="hidden")
|
| 124 |
-
# with gr.Column():
|
| 125 |
-
# output_image = gr.Image(label="Overlap image")
|
| 126 |
-
# output_mesh = gr.Model3D(display_mode="wireframe", label="3D Mesh")
|
| 127 |
-
|
| 128 |
-
# gr.HTML("""<br/>""")
|
| 129 |
-
|
| 130 |
-
# with gr.Row():
|
| 131 |
-
# send_btn = gr.Button("Inference")
|
| 132 |
-
# send_btn.click(fn=inference, inputs=[crop_image], outputs=[output_image, output_mesh])
|
| 133 |
-
|
| 134 |
-
# example_images = gr.Examples([
|
| 135 |
-
# ['example_data/000000015956_horse.png'],
|
| 136 |
-
# ['example_data/n02101388_1188.png'],
|
| 137 |
-
# ['example_data/n02412080_12159.png'],
|
| 138 |
-
# ['example_data/000000101684_zebra.png']
|
| 139 |
-
# ],
|
| 140 |
-
# inputs=[input_image])
|
| 141 |
-
|
| 142 |
-
# demo.launch(debug=True)
|
| 143 |
-
|
| 144 |
-
|
| 145 |
demo = gr.Interface(
|
| 146 |
fn=inference,
|
| 147 |
analytics_enabled=False,
|
|
@@ -152,10 +119,9 @@ demo = gr.Interface(
|
|
| 152 |
gr.Image(label="Overlap image"),
|
| 153 |
gr.Model3D(display_mode="wireframe", label="3D Mesh"),
|
| 154 |
],
|
| 155 |
-
title="AniMer",
|
| 156 |
description="""
|
| 157 |
-
|
| 158 |
-
https://luoxue-star.github.io/AniMer_project_page/
|
| 159 |
## Steps for Use
|
| 160 |
1. **Input**: Select an example image or upload your own image.
|
| 161 |
2. **Crop**: Crop the animal in the image (Otherwise, the result may be poor.)
|
|
|
|
| 109 |
return (None, [])
|
| 110 |
|
| 111 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 112 |
demo = gr.Interface(
|
| 113 |
fn=inference,
|
| 114 |
analytics_enabled=False,
|
|
|
|
| 119 |
gr.Image(label="Overlap image"),
|
| 120 |
gr.Model3D(display_mode="wireframe", label="3D Mesh"),
|
| 121 |
],
|
| 122 |
+
title="AniMer: Animal Pose and Shape Estimation Using Family Aware Transformer",
|
| 123 |
description="""
|
| 124 |
+
Project page: https://luoxue-star.github.io/AniMer_project_page/
|
|
|
|
| 125 |
## Steps for Use
|
| 126 |
1. **Input**: Select an example image or upload your own image.
|
| 127 |
2. **Crop**: Crop the animal in the image (Otherwise, the result may be poor.)
|
config/config.yaml
CHANGED
|
@@ -38,6 +38,7 @@ EXTRA:
|
|
| 38 |
NUM_LOG_SAMPLES_PER_IMAGE: 4
|
| 39 |
PELVIS_IND: 0
|
| 40 |
MODEL:
|
|
|
|
| 41 |
IMAGE_SIZE: 256
|
| 42 |
IMAGE_MEAN:
|
| 43 |
- 0.485
|
|
|
|
| 38 |
NUM_LOG_SAMPLES_PER_IMAGE: 4
|
| 39 |
PELVIS_IND: 0
|
| 40 |
MODEL:
|
| 41 |
+
USE_CLS: true
|
| 42 |
IMAGE_SIZE: 256
|
| 43 |
IMAGE_MEAN:
|
| 44 |
- 0.485
|