Spaces:
Running
on
Zero
Running
on
Zero
enable zerogpu
Browse files
app.py
CHANGED
@@ -256,6 +256,15 @@ hands = mp_hands.Hands(
|
|
256 |
min_detection_confidence=0.1,
|
257 |
)
|
258 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
259 |
def get_ref_anno(ref):
|
260 |
print("inside get_ref_anno")
|
261 |
if ref is None:
|
@@ -322,15 +331,6 @@ def get_ref_anno(ref):
|
|
322 |
hand_mask = np.zeros_like(img[:,:, 0])
|
323 |
ref_pose = np.zeros_like(img)
|
324 |
|
325 |
-
@spaces.GPU(duration=60)
|
326 |
-
def make_ref_cond(
|
327 |
-
image
|
328 |
-
):
|
329 |
-
print("ready to run autoencoder")
|
330 |
-
# print(f"image.device: {image.device}, type(image): {type(image)}")
|
331 |
-
latent = opts.latent_scaling_factor * autoencoder.encode(image[None, ...]).sample()
|
332 |
-
return image[None, ...], latent
|
333 |
-
|
334 |
image_transform = Compose(
|
335 |
[
|
336 |
ToTensor(),
|
|
|
256 |
min_detection_confidence=0.1,
|
257 |
)
|
258 |
|
259 |
+
@spaces.GPU(duration=60)
|
260 |
+
def make_ref_cond(
|
261 |
+
image
|
262 |
+
):
|
263 |
+
print("ready to run autoencoder")
|
264 |
+
# print(f"image.device: {image.device}, type(image): {type(image)}")
|
265 |
+
latent = opts.latent_scaling_factor * autoencoder.encode(image[None, ...].to("cuda")).sample()
|
266 |
+
return image[None, ...], latent
|
267 |
+
|
268 |
def get_ref_anno(ref):
|
269 |
print("inside get_ref_anno")
|
270 |
if ref is None:
|
|
|
331 |
hand_mask = np.zeros_like(img[:,:, 0])
|
332 |
ref_pose = np.zeros_like(img)
|
333 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
334 |
image_transform = Compose(
|
335 |
[
|
336 |
ToTensor(),
|