Spaces:
Running
on
Zero
Running
on
Zero
NIRVANALAN
commited on
Commit
·
84b10e1
1
Parent(s):
07be3e2
update
Browse files
app.py
CHANGED
|
@@ -32,6 +32,16 @@ import numpy as np
|
|
| 32 |
import torch as th
|
| 33 |
import torch.distributed as dist
|
| 34 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
from guided_diffusion import dist_util, logger
|
| 36 |
from guided_diffusion.script_util import (
|
| 37 |
NUM_CLASSES,
|
|
@@ -67,13 +77,6 @@ from utils.infer_utils import remove_background, resize_foreground
|
|
| 67 |
|
| 68 |
SEED = 0
|
| 69 |
|
| 70 |
-
def install_dependency():
|
| 71 |
-
# install apex
|
| 72 |
-
subprocess.run(
|
| 73 |
-
f'{sys.executable} -m pip install -v --disable-pip-version-check --no-cache-dir --no-build-isolation --config-settings "--build-option=--cpp_ext" --config-settings "--build-option=--cuda_ext" git@https://github.com/NVIDIA/apex.git',
|
| 74 |
-
shell=True,
|
| 75 |
-
)
|
| 76 |
-
|
| 77 |
|
| 78 |
def resize_to_224(img):
|
| 79 |
img = transforms.functional.resize(img, 224,
|
|
@@ -460,7 +463,6 @@ if __name__ == "__main__":
|
|
| 460 |
|
| 461 |
args.rendering_kwargs = rendering_options_defaults(args)
|
| 462 |
|
| 463 |
-
install_dependency()
|
| 464 |
|
| 465 |
# main(args)
|
| 466 |
|
|
|
|
| 32 |
import torch as th
|
| 33 |
import torch.distributed as dist
|
| 34 |
|
| 35 |
+
def install_dependency():
|
| 36 |
+
# install apex
|
| 37 |
+
subprocess.run(
|
| 38 |
+
f'{sys.executable} -m pip install -v --disable-pip-version-check --no-cache-dir --no-build-isolation --config-settings "--build-option=--cpp_ext" --config-settings "--build-option=--cuda_ext" git@https://github.com/NVIDIA/apex.git',
|
| 39 |
+
shell=True,
|
| 40 |
+
)
|
| 41 |
+
|
| 42 |
+
|
| 43 |
+
install_dependency()
|
| 44 |
+
|
| 45 |
from guided_diffusion import dist_util, logger
|
| 46 |
from guided_diffusion.script_util import (
|
| 47 |
NUM_CLASSES,
|
|
|
|
| 77 |
|
| 78 |
SEED = 0
|
| 79 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 80 |
|
| 81 |
def resize_to_224(img):
|
| 82 |
img = transforms.functional.resize(img, 224,
|
|
|
|
| 463 |
|
| 464 |
args.rendering_kwargs = rendering_options_defaults(args)
|
| 465 |
|
|
|
|
| 466 |
|
| 467 |
# main(args)
|
| 468 |
|