Spaces:
Running
on
Zero
Running
on
Zero
Delete unused code
Browse files- app.py +2 -6
- pipeline_objectclear.py +0 -1
app.py
CHANGED
|
@@ -2,19 +2,16 @@ import gradio as gr
|
|
| 2 |
import os
|
| 3 |
from PIL import Image
|
| 4 |
import torch
|
| 5 |
-
from diffusers.utils import
|
| 6 |
from pipeline_objectclear import ObjectClearPipeline
|
| 7 |
from tools.download_util import load_file_from_url
|
| 8 |
from tools.painter import mask_painter
|
| 9 |
import argparse
|
| 10 |
-
from safetensors.torch import load_file
|
| 11 |
-
from model import CLIPImageEncoder, PostfuseModule
|
| 12 |
import numpy as np
|
| 13 |
import torchvision.transforms.functional as TF
|
| 14 |
from scipy.ndimage import convolve, zoom
|
| 15 |
import cv2
|
| 16 |
import time
|
| 17 |
-
from huggingface_hub import hf_hub_download
|
| 18 |
import spaces
|
| 19 |
|
| 20 |
from tools.interact_tools import SamControler
|
|
@@ -284,8 +281,7 @@ pipe = ObjectClearPipeline.from_pretrained_with_custom_modules(
|
|
| 284 |
"jixin0101/ObjectClear",
|
| 285 |
torch_dtype=torch.float16,
|
| 286 |
variant='fp16',
|
| 287 |
-
save_cross_attn=True
|
| 288 |
-
cache_dir="/home/jovyan/shared/jixinzhao/models",
|
| 289 |
)
|
| 290 |
|
| 291 |
pipe.to(device)
|
|
|
|
| 2 |
import os
|
| 3 |
from PIL import Image
|
| 4 |
import torch
|
| 5 |
+
from diffusers.utils import check_min_version
|
| 6 |
from pipeline_objectclear import ObjectClearPipeline
|
| 7 |
from tools.download_util import load_file_from_url
|
| 8 |
from tools.painter import mask_painter
|
| 9 |
import argparse
|
|
|
|
|
|
|
| 10 |
import numpy as np
|
| 11 |
import torchvision.transforms.functional as TF
|
| 12 |
from scipy.ndimage import convolve, zoom
|
| 13 |
import cv2
|
| 14 |
import time
|
|
|
|
| 15 |
import spaces
|
| 16 |
|
| 17 |
from tools.interact_tools import SamControler
|
|
|
|
| 281 |
"jixin0101/ObjectClear",
|
| 282 |
torch_dtype=torch.float16,
|
| 283 |
variant='fp16',
|
| 284 |
+
save_cross_attn=True
|
|
|
|
| 285 |
)
|
| 286 |
|
| 287 |
pipe.to(device)
|
pipeline_objectclear.py
CHANGED
|
@@ -60,7 +60,6 @@ from diffusers.pipelines.stable_diffusion_xl.pipeline_output import StableDiffus
|
|
| 60 |
from model import CLIPImageEncoder, PostfuseModule
|
| 61 |
import gc
|
| 62 |
import torch.nn.functional as F
|
| 63 |
-
import cv2
|
| 64 |
|
| 65 |
|
| 66 |
if is_invisible_watermark_available():
|
|
|
|
| 60 |
from model import CLIPImageEncoder, PostfuseModule
|
| 61 |
import gc
|
| 62 |
import torch.nn.functional as F
|
|
|
|
| 63 |
|
| 64 |
|
| 65 |
if is_invisible_watermark_available():
|