Spaces:
Runtime error
Runtime error
enable zerogpu
Browse files
app.py
CHANGED
@@ -256,6 +256,7 @@ hands = mp_hands.Hands(
|
|
256 |
min_detection_confidence=0.1,
|
257 |
)
|
258 |
|
|
|
259 |
def make_ref_cond(
|
260 |
image
|
261 |
):
|
@@ -263,6 +264,7 @@ def make_ref_cond(
|
|
263 |
# print(f"image.device: {image.device}, type(image): {type(image)}")
|
264 |
# image = image.to("cuda")
|
265 |
print(f"autoencoder device: {next(autoencoder.parameters()).device}")
|
|
|
266 |
latent = opts.latent_scaling_factor * autoencoder.encode(image[None, ...]).sample()
|
267 |
return image[None, ...], latent
|
268 |
|
@@ -548,8 +550,7 @@ def sample_diff(ref_cond, target_cond, target_keypts, num_gen, seed, cfg):
|
|
548 |
else:
|
549 |
results.append(placeholder)
|
550 |
results_pose.append(placeholder)
|
551 |
-
|
552 |
-
print("sampled_image.png saved")
|
553 |
return results, results_pose
|
554 |
|
555 |
@spaces.GPU(duration=120)
|
|
|
256 |
min_detection_confidence=0.1,
|
257 |
)
|
258 |
|
259 |
+
@spaces.GPU
|
260 |
def make_ref_cond(
|
261 |
image
|
262 |
):
|
|
|
264 |
# print(f"image.device: {image.device}, type(image): {type(image)}")
|
265 |
# image = image.to("cuda")
|
266 |
print(f"autoencoder device: {next(autoencoder.parameters()).device}")
|
267 |
+
image = image.to(next(autoencoder.parameters()).device)
|
268 |
latent = opts.latent_scaling_factor * autoencoder.encode(image[None, ...]).sample()
|
269 |
return image[None, ...], latent
|
270 |
|
|
|
550 |
else:
|
551 |
results.append(placeholder)
|
552 |
results_pose.append(placeholder)
|
553 |
+
print(f"results[0].max(): {results[0].max()}")
|
|
|
554 |
return results, results_pose
|
555 |
|
556 |
@spaces.GPU(duration=120)
|