Spaces:
Runtime error
Runtime error
Ahsen Khaliq commited on
Commit ·
2f67dd1
1
Parent(s): 195971a
Update app.py
Browse files
app.py
CHANGED
|
@@ -513,11 +513,7 @@ def main(input_path, model_path, output_dir, need_animation=False, resize_h=None
|
|
| 513 |
save_all=True, append_images=all_frames[1:], optimize=False, duration=40, loop=0)
|
| 514 |
return os.path.join(frame_dir, "animation.gif"), tensor_to_pil
|
| 515 |
|
| 516 |
-
|
| 517 |
-
img = Image.open( infilename )
|
| 518 |
-
img.load()
|
| 519 |
-
data = np.asarray( img, dtype="int32" )
|
| 520 |
-
return data
|
| 521 |
|
| 522 |
def gradio_inference(image):
|
| 523 |
return main(input_path=image.name,
|
|
@@ -534,7 +530,7 @@ def throttled_inference(image):
|
|
| 534 |
current = inferences_running
|
| 535 |
if current >= 4:
|
| 536 |
print(f"Rejected inference when we already had {current} running")
|
| 537 |
-
return
|
| 538 |
print(f"Inference starting when we already had {current} running")
|
| 539 |
inferences_running += 1
|
| 540 |
try:
|
|
|
|
| 513 |
save_all=True, append_images=all_frames[1:], optimize=False, duration=40, loop=0)
|
| 514 |
return os.path.join(frame_dir, "animation.gif"), tensor_to_pil
|
| 515 |
|
| 516 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
| 517 |
|
| 518 |
def gradio_inference(image):
|
| 519 |
return main(input_path=image.name,
|
|
|
|
| 530 |
current = inferences_running
|
| 531 |
if current >= 4:
|
| 532 |
print(f"Rejected inference when we already had {current} running")
|
| 533 |
+
return "./gpu.jpg"
|
| 534 |
print(f"Inference starting when we already had {current} running")
|
| 535 |
inferences_running += 1
|
| 536 |
try:
|