Spaces:
Sleeping
Sleeping
Try to migrate to ZERO.
Browse files- README.md +1 -1
- app.py +6 -2
- citydreamer/extensions/grid_encoder/setup.py +2 -2
- citydreamer/model.py +5 -3
- requirements.txt +2 -2
README.md
CHANGED
@@ -4,7 +4,7 @@ emoji: 🏙️
|
|
4 |
colorFrom: blue
|
5 |
colorTo: green
|
6 |
sdk: gradio
|
7 |
-
sdk_version: 4.
|
8 |
app_file: app.py
|
9 |
pinned: false
|
10 |
license: other
|
|
|
4 |
colorFrom: blue
|
5 |
colorTo: green
|
6 |
sdk: gradio
|
7 |
+
sdk_version: 4.44.0
|
8 |
app_file: app.py
|
9 |
pinned: false
|
10 |
license: other
|
app.py
CHANGED
@@ -4,13 +4,14 @@
|
|
4 |
# @Author: Haozhe Xie
|
5 |
# @Date: 2024-03-02 16:30:00
|
6 |
# @Last Modified by: Haozhe Xie
|
7 |
-
# @Last Modified at: 2024-
|
8 |
# @Email: root@haozhexie.com
|
9 |
|
10 |
import gradio as gr
|
11 |
import logging
|
12 |
import numpy as np
|
13 |
import os
|
|
|
14 |
import ssl
|
15 |
import subprocess
|
16 |
import sys
|
@@ -61,7 +62,10 @@ def get_city_layout():
|
|
61 |
return hf, seg
|
62 |
|
63 |
|
64 |
-
|
|
|
|
|
|
|
65 |
# The import must be done after CUDA extension compilation
|
66 |
import citydreamer.inference
|
67 |
|
|
|
4 |
# @Author: Haozhe Xie
|
5 |
# @Date: 2024-03-02 16:30:00
|
6 |
# @Last Modified by: Haozhe Xie
|
7 |
+
# @Last Modified at: 2024-09-21 10:36:47
|
8 |
# @Email: root@haozhexie.com
|
9 |
|
10 |
import gradio as gr
|
11 |
import logging
|
12 |
import numpy as np
|
13 |
import os
|
14 |
+
import spaces
|
15 |
import ssl
|
16 |
import subprocess
|
17 |
import sys
|
|
|
62 |
return hf, seg
|
63 |
|
64 |
|
65 |
+
@spaces.GPU
|
66 |
+
def get_generated_city(
|
67 |
+
radius, altitude, azimuth, map_center, progress=gr.Progress(track_tqdm=True)
|
68 |
+
):
|
69 |
# The import must be done after CUDA extension compilation
|
70 |
import citydreamer.inference
|
71 |
|
citydreamer/extensions/grid_encoder/setup.py
CHANGED
@@ -22,10 +22,10 @@ setup(
|
|
22 |
"bindings.cpp",
|
23 |
],
|
24 |
extra_compile_args={
|
25 |
-
"cxx": ["-O3", "-std=c++
|
26 |
"nvcc": [
|
27 |
"-O3",
|
28 |
-
"-std=c++
|
29 |
"-U__CUDA_NO_HALF_OPERATORS__",
|
30 |
"-U__CUDA_NO_HALF_CONVERSIONS__",
|
31 |
"-U__CUDA_NO_HALF2_OPERATORS__",
|
|
|
22 |
"bindings.cpp",
|
23 |
],
|
24 |
extra_compile_args={
|
25 |
+
"cxx": ["-O3", "-std=c++17"],
|
26 |
"nvcc": [
|
27 |
"-O3",
|
28 |
+
"-std=c++17",
|
29 |
"-U__CUDA_NO_HALF_OPERATORS__",
|
30 |
"-U__CUDA_NO_HALF_CONVERSIONS__",
|
31 |
"-U__CUDA_NO_HALF2_OPERATORS__",
|
citydreamer/model.py
CHANGED
@@ -610,9 +610,11 @@ class RenderMLP(torch.nn.Module):
|
|
610 |
in_dim = f_dim
|
611 |
|
612 |
self.fc_m_a = torch.nn.Linear(
|
613 |
-
|
614 |
-
|
615 |
-
|
|
|
|
|
616 |
cfg.NETWORK.GANCRAFT.RENDER_HIDDEN_DIM,
|
617 |
bias=False,
|
618 |
)
|
|
|
610 |
in_dim = f_dim
|
611 |
|
612 |
self.fc_m_a = torch.nn.Linear(
|
613 |
+
(
|
614 |
+
cfg.NETWORK.GANCRAFT.N_CLASSES + 1
|
615 |
+
if cfg.NETWORK.GANCRAFT.BUILDING_MODE
|
616 |
+
else cfg.NETWORK.GANCRAFT.N_CLASSES
|
617 |
+
),
|
618 |
cfg.NETWORK.GANCRAFT.RENDER_HIDDEN_DIM,
|
619 |
bias=False,
|
620 |
)
|
requirements.txt
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
-
--extra-index-url https://download.pytorch.org/whl/
|
2 |
-
torch==
|
3 |
torchvision
|
4 |
|
5 |
easydict
|
|
|
1 |
+
--extra-index-url https://download.pytorch.org/whl/cu118
|
2 |
+
torch==2.4.1
|
3 |
torchvision
|
4 |
|
5 |
easydict
|