Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -3,12 +3,18 @@ import numpy as np
|
|
3 |
import gradio as gr
|
4 |
import spaces
|
5 |
import cv2
|
|
|
6 |
|
7 |
from typing import Dict
|
8 |
from torchvision.transforms.functional import to_tensor, center_crop, resize
|
9 |
from PIL import Image
|
|
|
10 |
|
11 |
-
|
|
|
|
|
|
|
|
|
12 |
|
13 |
engage_logo = Image.open("engage_studios_logo.png").resize((700, 88), Image.Resampling.BICUBIC)
|
14 |
engage_logo_mask = np.array(engage_logo.split()[-1])[..., None] / 255
|
|
|
3 |
import gradio as gr
|
4 |
import spaces
|
5 |
import cv2
|
6 |
+
import os
|
7 |
|
8 |
from typing import Dict
|
9 |
from torchvision.transforms.functional import to_tensor, center_crop, resize
|
10 |
from PIL import Image
|
11 |
+
from huggingface_hub import Repository
|
12 |
|
13 |
+
token = os.environ['model_fetch']
|
14 |
+
|
15 |
+
engine_repo = Repository(local_dir="engine", clone_from="felixrosberg/EngageDiffusion", use_auth_token=token)
|
16 |
+
|
17 |
+
from engine.ui_model import fetch_model, process_sketch, process_mask
|
18 |
|
19 |
engage_logo = Image.open("engage_studios_logo.png").resize((700, 88), Image.Resampling.BICUBIC)
|
20 |
engage_logo_mask = np.array(engage_logo.split()[-1])[..., None] / 255
|