Spaces:
Runtime error
Runtime error
Commit
·
2c98aad
1
Parent(s):
7a66168
HarmonyView update
Browse files- .idea/workspace.xml +11 -6
- README.md +1 -1
- app.py +6 -6
.idea/workspace.xml
CHANGED
|
@@ -4,10 +4,7 @@
|
|
| 4 |
<option name="autoReloadType" value="SELECTIVE" />
|
| 5 |
</component>
|
| 6 |
<component name="ChangeListManager">
|
| 7 |
-
<list default="true" id="a993d736-6297-4164-9c29-6b2ab1055a96" name="변경" comment="HarmonyView update"
|
| 8 |
-
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
| 9 |
-
<change beforePath="$PROJECT_DIR$/app.py" beforeDir="false" afterPath="$PROJECT_DIR$/app.py" afterDir="false" />
|
| 10 |
-
</list>
|
| 11 |
<option name="SHOW_DIALOG" value="false" />
|
| 12 |
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
| 13 |
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
|
@@ -65,7 +62,7 @@
|
|
| 65 |
<workItem from="1704106389325" duration="3000" />
|
| 66 |
<workItem from="1707152826665" duration="2000" />
|
| 67 |
<workItem from="1709009070011" duration="10000" />
|
| 68 |
-
<workItem from="1717834285162" duration="
|
| 69 |
</task>
|
| 70 |
<task id="LOCAL-00001" summary="error resolve">
|
| 71 |
<option name="closed" value="true" />
|
|
@@ -259,7 +256,15 @@
|
|
| 259 |
<option name="project" value="LOCAL" />
|
| 260 |
<updated>1717834384940</updated>
|
| 261 |
</task>
|
| 262 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 263 |
<servers />
|
| 264 |
</component>
|
| 265 |
<component name="Vcs.Log.Tabs.Properties">
|
|
|
|
| 4 |
<option name="autoReloadType" value="SELECTIVE" />
|
| 5 |
</component>
|
| 6 |
<component name="ChangeListManager">
|
| 7 |
+
<list default="true" id="a993d736-6297-4164-9c29-6b2ab1055a96" name="변경" comment="HarmonyView update" />
|
|
|
|
|
|
|
|
|
|
| 8 |
<option name="SHOW_DIALOG" value="false" />
|
| 9 |
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
| 10 |
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
|
|
|
| 62 |
<workItem from="1704106389325" duration="3000" />
|
| 63 |
<workItem from="1707152826665" duration="2000" />
|
| 64 |
<workItem from="1709009070011" duration="10000" />
|
| 65 |
+
<workItem from="1717834285162" duration="1496000" />
|
| 66 |
</task>
|
| 67 |
<task id="LOCAL-00001" summary="error resolve">
|
| 68 |
<option name="closed" value="true" />
|
|
|
|
| 256 |
<option name="project" value="LOCAL" />
|
| 257 |
<updated>1717834384940</updated>
|
| 258 |
</task>
|
| 259 |
+
<task id="LOCAL-00025" summary="HarmonyView update">
|
| 260 |
+
<option name="closed" value="true" />
|
| 261 |
+
<created>1717835213390</created>
|
| 262 |
+
<option name="number" value="00025" />
|
| 263 |
+
<option name="presentableId" value="LOCAL-00025" />
|
| 264 |
+
<option name="project" value="LOCAL" />
|
| 265 |
+
<updated>1717835213390</updated>
|
| 266 |
+
</task>
|
| 267 |
+
<option name="localTasksCounter" value="26" />
|
| 268 |
<servers />
|
| 269 |
</component>
|
| 270 |
<component name="Vcs.Log.Tabs.Properties">
|
README.md
CHANGED
|
@@ -4,7 +4,7 @@ emoji: 🚀
|
|
| 4 |
colorFrom: indigo
|
| 5 |
colorTo: pink
|
| 6 |
sdk: gradio
|
| 7 |
-
sdk_version:
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
license: cc-by-sa-3.0
|
|
|
|
| 4 |
colorFrom: indigo
|
| 5 |
colorTo: pink
|
| 6 |
sdk: gradio
|
| 7 |
+
sdk_version: 4.35.0
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
license: cc-by-sa-3.0
|
app.py
CHANGED
|
@@ -193,7 +193,7 @@ def run_demo():
|
|
| 193 |
['hf_demo/examples/teapot.png',20,200,"SAM output"],
|
| 194 |
]
|
| 195 |
|
| 196 |
-
image_block = gr.
|
| 197 |
elevation = gr.Slider(-10, 40, 30, step=5, label='Elevation angle', interactive=True)
|
| 198 |
crop_size = gr.Slider(120, 240, 200, step=10, label='Crop size', interactive=True)
|
| 199 |
background_removal = gr.Radio(["Input image", "SAM output"], label="Input to HarmonyView", info="Which image do you want for the input to HarmonyView?")
|
|
@@ -220,17 +220,17 @@ def run_demo():
|
|
| 220 |
with gr.Column(scale=0.8):
|
| 221 |
image_block.render()
|
| 222 |
crop_size.render()
|
| 223 |
-
fig0 = gr.
|
| 224 |
|
| 225 |
|
| 226 |
with gr.Column(scale=0.8):
|
| 227 |
-
sam_block = gr.
|
| 228 |
# crop_btn = gr.Button('Crop it', variant='primary', interactive=True)
|
| 229 |
elevation.render()
|
| 230 |
-
fig1 = gr.
|
| 231 |
|
| 232 |
with gr.Column(scale=0.8):
|
| 233 |
-
input_block = gr.
|
| 234 |
background_removal.render()
|
| 235 |
with gr.Accordion('Advanced options', open=False):
|
| 236 |
cfg_scale_1 = gr.Slider(1.0, 5.0, 2.0, step=0.1, label='Classifier free guidance 1', info='How consistent to be with the Input image', interactive=True)
|
|
@@ -238,7 +238,7 @@ def run_demo():
|
|
| 238 |
seed = gr.Number(6033, label='Random seed', interactive=True)
|
| 239 |
run_btn = gr.Button('Run generation', variant='primary', interactive=True)
|
| 240 |
|
| 241 |
-
output_block = gr.
|
| 242 |
|
| 243 |
image_block.change(fn=partial(sam_predict, mask_predictor, removal), inputs=[image_block], outputs=[sam_block], queue=True) \
|
| 244 |
.success(fn=resize_inputs, inputs=[image_block, sam_block, crop_size, background_removal], outputs=[input_block], queue=True)
|
|
|
|
| 193 |
['hf_demo/examples/teapot.png',20,200,"SAM output"],
|
| 194 |
]
|
| 195 |
|
| 196 |
+
image_block = gr.ImageEditor(type='pil', image_mode='RGBA', height=256, label='Input image', interactive=True)
|
| 197 |
elevation = gr.Slider(-10, 40, 30, step=5, label='Elevation angle', interactive=True)
|
| 198 |
crop_size = gr.Slider(120, 240, 200, step=10, label='Crop size', interactive=True)
|
| 199 |
background_removal = gr.Radio(["Input image", "SAM output"], label="Input to HarmonyView", info="Which image do you want for the input to HarmonyView?")
|
|
|
|
| 220 |
with gr.Column(scale=0.8):
|
| 221 |
image_block.render()
|
| 222 |
crop_size.render()
|
| 223 |
+
fig0 = gr.ImageEditor(value=Image.open('assets/crop_size.jpg'), type='pil', image_mode='RGB', height=256, show_label=False, tool=None, interactive=False)
|
| 224 |
|
| 225 |
|
| 226 |
with gr.Column(scale=0.8):
|
| 227 |
+
sam_block = gr.ImageEditor(type='pil', image_mode='RGBA', label="SAM output", height=256, interactive=False)
|
| 228 |
# crop_btn = gr.Button('Crop it', variant='primary', interactive=True)
|
| 229 |
elevation.render()
|
| 230 |
+
fig1 = gr.ImageEditor(value=Image.open('assets/elevation.jpg'), type='pil', image_mode='RGB', height=256, show_label=False, tool=None, interactive=False)
|
| 231 |
|
| 232 |
with gr.Column(scale=0.8):
|
| 233 |
+
input_block = gr.ImageEditor(type='pil', image_mode='RGBA', label="Input to HarmonyView", height=256, tool=None, interactive=False)
|
| 234 |
background_removal.render()
|
| 235 |
with gr.Accordion('Advanced options', open=False):
|
| 236 |
cfg_scale_1 = gr.Slider(1.0, 5.0, 2.0, step=0.1, label='Classifier free guidance 1', info='How consistent to be with the Input image', interactive=True)
|
|
|
|
| 238 |
seed = gr.Number(6033, label='Random seed', interactive=True)
|
| 239 |
run_btn = gr.Button('Run generation', variant='primary', interactive=True)
|
| 240 |
|
| 241 |
+
output_block = gr.ImageEditor(type='pil', image_mode='RGB', label="Outputs of HarmonyView", height=256, interactive=False)
|
| 242 |
|
| 243 |
image_block.change(fn=partial(sam_predict, mask_predictor, removal), inputs=[image_block], outputs=[sam_block], queue=True) \
|
| 244 |
.success(fn=resize_inputs, inputs=[image_block, sam_block, crop_size, background_removal], outputs=[input_block], queue=True)
|