Spaces:
Paused
Paused
github-actions[bot] commited on
Commit ·
dbf1f41
1
Parent(s): 29b5ac5
Automated Deploy: 236abd04451d1439492ce6c7af505fb0dafbc30a
Browse files- config/lighting.py +1 -1
- config/runtime.py +7 -0
- services/lighting/shading.py +76 -1
- services/pipeline/builder.py +23 -3
- services/pipeline/bundle_assembly.py +7 -1
- test_fast_shadow_transfer.py +36 -0
- visualizer.gpu.toml +2 -0
- visualizer.hf.toml +2 -0
- visualizer.local.toml +3 -1
config/lighting.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
LIGHTING_TRANSFER_VERSION =
|
| 2 |
|
| 3 |
SHADE_MAP_MIN = 0.15
|
| 4 |
SHADE_MAP_MAX = 1.10
|
|
|
|
| 1 |
+
LIGHTING_TRANSFER_VERSION = 5
|
| 2 |
|
| 3 |
SHADE_MAP_MIN = 0.15
|
| 4 |
SHADE_MAP_MAX = 1.10
|
config/runtime.py
CHANGED
|
@@ -9,6 +9,9 @@ ENABLE_MULTI_PLANE_SURFACES = config_bool("ENABLE_MULTI_PLANE_SURFACES", "runtim
|
|
| 9 |
ENABLE_WALL_SEGMENTS = config_bool("ENABLE_WALL_SEGMENTS", "runtime", "enable_wall_segments", "0")
|
| 10 |
ENABLE_INTRINSIC_SHADING = config_bool("ENABLE_INTRINSIC_SHADING", "runtime", "enable_intrinsic_shading", "0")
|
| 11 |
ENABLE_SHADING_TRANSFER = config_bool("ENABLE_SHADING_TRANSFER", "runtime", "enable_shading_transfer", "1")
|
|
|
|
|
|
|
|
|
|
| 12 |
WARM_START_MODELS = config_bool("WARM_START_MODELS", "runtime", "warm_start_models", "1")
|
| 13 |
|
| 14 |
ENABLE_ONNX_INFERENCE = config_bool("ENABLE_ONNX_INFERENCE", "runtime", "enable_onnx_inference", "0")
|
|
@@ -33,6 +36,10 @@ INFERENCE_MAX_DIMENSION = max(512, int(config_value(
|
|
| 33 |
"INFERENCE_MAX_DIMENSION", "runtime", "inference_max_dimension", "1024",
|
| 34 |
)))
|
| 35 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
ROOM_UPLOAD_JPEG_QUALITY = min(95, max(50, int(config_value(
|
| 37 |
"ROOM_UPLOAD_JPEG_QUALITY", "runtime", "room_upload_jpeg_quality", "85",
|
| 38 |
))))
|
|
|
|
| 9 |
ENABLE_WALL_SEGMENTS = config_bool("ENABLE_WALL_SEGMENTS", "runtime", "enable_wall_segments", "0")
|
| 10 |
ENABLE_INTRINSIC_SHADING = config_bool("ENABLE_INTRINSIC_SHADING", "runtime", "enable_intrinsic_shading", "0")
|
| 11 |
ENABLE_SHADING_TRANSFER = config_bool("ENABLE_SHADING_TRANSFER", "runtime", "enable_shading_transfer", "1")
|
| 12 |
+
ENABLE_FAST_SHADOW_TRANSFER = config_bool(
|
| 13 |
+
"ENABLE_FAST_SHADOW_TRANSFER", "runtime", "enable_fast_shadow_transfer", "0",
|
| 14 |
+
)
|
| 15 |
WARM_START_MODELS = config_bool("WARM_START_MODELS", "runtime", "warm_start_models", "1")
|
| 16 |
|
| 17 |
ENABLE_ONNX_INFERENCE = config_bool("ENABLE_ONNX_INFERENCE", "runtime", "enable_onnx_inference", "0")
|
|
|
|
| 36 |
"INFERENCE_MAX_DIMENSION", "runtime", "inference_max_dimension", "1024",
|
| 37 |
)))
|
| 38 |
|
| 39 |
+
FAST_SHADOW_MAX_DIMENSION = max(256, min(1024, int(config_value(
|
| 40 |
+
"FAST_SHADOW_MAX_DIMENSION", "runtime", "fast_shadow_max_dimension", "640",
|
| 41 |
+
))))
|
| 42 |
+
|
| 43 |
ROOM_UPLOAD_JPEG_QUALITY = min(95, max(50, int(config_value(
|
| 44 |
"ROOM_UPLOAD_JPEG_QUALITY", "runtime", "room_upload_jpeg_quality", "85",
|
| 45 |
))))
|
services/lighting/shading.py
CHANGED
|
@@ -9,6 +9,7 @@ from config.lighting import (
|
|
| 9 |
SHADE_MAP_MAX,
|
| 10 |
SHADE_MAP_MIN,
|
| 11 |
)
|
|
|
|
| 12 |
from services.lighting.luminance import (
|
| 13 |
encode_relative_map,
|
| 14 |
image_linear_luminance,
|
|
@@ -100,6 +101,74 @@ def suppress_replaced_material_lighting(
|
|
| 100 |
# Luminance-based lighting maps
|
| 101 |
# ---------------------------------------------------------------------------
|
| 102 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 103 |
def build_luminance_lighting_maps(
|
| 104 |
img_np: np.ndarray,
|
| 105 |
surface_mask: np.ndarray,
|
|
@@ -152,8 +221,14 @@ def build_luminance_lighting_maps(
|
|
| 152 |
# ---------------------------------------------------------------------------
|
| 153 |
|
| 154 |
def lighting_map_statistics(encoded: np.ndarray | None, surface_mask: np.ndarray) -> dict | None:
|
| 155 |
-
if encoded is None
|
| 156 |
return None
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 157 |
decoded = SHADE_MAP_MIN + (encoded.astype(np.float32) / 255.0) * (SHADE_MAP_MAX - SHADE_MAP_MIN)
|
| 158 |
values = decoded[surface_mask > 0]
|
| 159 |
if values.size == 0:
|
|
|
|
| 9 |
SHADE_MAP_MAX,
|
| 10 |
SHADE_MAP_MIN,
|
| 11 |
)
|
| 12 |
+
from config.runtime import FAST_SHADOW_MAX_DIMENSION
|
| 13 |
from services.lighting.luminance import (
|
| 14 |
encode_relative_map,
|
| 15 |
image_linear_luminance,
|
|
|
|
| 101 |
# Luminance-based lighting maps
|
| 102 |
# ---------------------------------------------------------------------------
|
| 103 |
|
| 104 |
+
def build_fast_shadow_lighting_maps(
|
| 105 |
+
img_np: np.ndarray,
|
| 106 |
+
surface_mask: np.ndarray,
|
| 107 |
+
replaced_material_mask: np.ndarray | None = None,
|
| 108 |
+
) -> dict[str, np.ndarray | None] | None:
|
| 109 |
+
"""Extract broad room shadows on a bounded working image.
|
| 110 |
+
|
| 111 |
+
Unlike the legacy lighting path, this does not run intrinsic inference,
|
| 112 |
+
calculate reflections, or process several full-resolution float maps. The
|
| 113 |
+
resulting low-resolution shade texture is sampled linearly by the renderer.
|
| 114 |
+
"""
|
| 115 |
+
if not surface_mask.any():
|
| 116 |
+
return None
|
| 117 |
+
|
| 118 |
+
source_h, source_w = surface_mask.shape[:2]
|
| 119 |
+
scale = min(1.0, FAST_SHADOW_MAX_DIMENSION / float(max(source_h, source_w)))
|
| 120 |
+
work_w = max(1, int(round(source_w * scale)))
|
| 121 |
+
work_h = max(1, int(round(source_h * scale)))
|
| 122 |
+
|
| 123 |
+
if (work_w, work_h) == (source_w, source_h):
|
| 124 |
+
work_image = img_np
|
| 125 |
+
work_mask = surface_mask.astype(np.uint8)
|
| 126 |
+
work_replaced_mask = replaced_material_mask
|
| 127 |
+
else:
|
| 128 |
+
work_image = cv2.resize(img_np, (work_w, work_h), interpolation=cv2.INTER_AREA)
|
| 129 |
+
work_mask = cv2.resize(
|
| 130 |
+
surface_mask.astype(np.uint8),
|
| 131 |
+
(work_w, work_h),
|
| 132 |
+
interpolation=cv2.INTER_NEAREST,
|
| 133 |
+
)
|
| 134 |
+
work_replaced_mask = (
|
| 135 |
+
cv2.resize(
|
| 136 |
+
replaced_material_mask.astype(np.uint8),
|
| 137 |
+
(work_w, work_h),
|
| 138 |
+
interpolation=cv2.INTER_NEAREST,
|
| 139 |
+
)
|
| 140 |
+
if replaced_material_mask is not None
|
| 141 |
+
else None
|
| 142 |
+
)
|
| 143 |
+
|
| 144 |
+
luminance = image_linear_luminance(work_image)
|
| 145 |
+
floor_values = luminance[work_mask > 0]
|
| 146 |
+
floor_values = floor_values[np.isfinite(floor_values) & (floor_values > 1e-6)]
|
| 147 |
+
if floor_values.size < max(64, int(work_h * work_w * 0.002)):
|
| 148 |
+
return None
|
| 149 |
+
|
| 150 |
+
median_lum = float(np.median(floor_values))
|
| 151 |
+
if median_lum < 1e-3:
|
| 152 |
+
return None
|
| 153 |
+
|
| 154 |
+
relative = luminance / median_lum
|
| 155 |
+
relative[~np.isfinite(relative)] = 1.0
|
| 156 |
+
relative[work_mask == 0] = 1.0
|
| 157 |
+
relative = suppress_replaced_material_lighting(
|
| 158 |
+
relative,
|
| 159 |
+
work_mask,
|
| 160 |
+
work_replaced_mask,
|
| 161 |
+
)
|
| 162 |
+
shade = smooth_relative_lighting(relative, work_mask)
|
| 163 |
+
if shade is None:
|
| 164 |
+
return None
|
| 165 |
+
|
| 166 |
+
return {
|
| 167 |
+
"shadeMap": encode_relative_map(shade, SHADE_MAP_MIN, SHADE_MAP_MAX),
|
| 168 |
+
"showroomShadeMap": None,
|
| 169 |
+
"reflectionMap": None,
|
| 170 |
+
}
|
| 171 |
+
|
| 172 |
def build_luminance_lighting_maps(
|
| 173 |
img_np: np.ndarray,
|
| 174 |
surface_mask: np.ndarray,
|
|
|
|
| 221 |
# ---------------------------------------------------------------------------
|
| 222 |
|
| 223 |
def lighting_map_statistics(encoded: np.ndarray | None, surface_mask: np.ndarray) -> dict | None:
|
| 224 |
+
if encoded is None:
|
| 225 |
return None
|
| 226 |
+
if encoded.shape[:2] != surface_mask.shape[:2]:
|
| 227 |
+
surface_mask = cv2.resize(
|
| 228 |
+
surface_mask.astype(np.uint8),
|
| 229 |
+
(encoded.shape[1], encoded.shape[0]),
|
| 230 |
+
interpolation=cv2.INTER_NEAREST,
|
| 231 |
+
)
|
| 232 |
decoded = SHADE_MAP_MIN + (encoded.astype(np.float32) / 255.0) * (SHADE_MAP_MAX - SHADE_MAP_MIN)
|
| 233 |
values = decoded[surface_mask > 0]
|
| 234 |
if values.size == 0:
|
services/pipeline/builder.py
CHANGED
|
@@ -9,7 +9,12 @@ import cv2
|
|
| 9 |
import numpy as np
|
| 10 |
from PIL import Image
|
| 11 |
|
| 12 |
-
from config.runtime import
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
from models.depth import estimate_scene_geometry
|
| 14 |
from models.loader import _load_intrinsic_model
|
| 15 |
from models.segmentation import active_model_metadata, run_segmentation
|
|
@@ -21,7 +26,11 @@ from services.floor.detection import estimate_floor_plane
|
|
| 21 |
from services.geometry.multi_plane import geometry_point_maps
|
| 22 |
from services.geometry.uv_mapping import build_surface_uv_mapping
|
| 23 |
from services.lighting.intrinsic import build_intrinsic_lighting_maps
|
| 24 |
-
from services.lighting.shading import
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
from services.pipeline.packaging import encode_bundle_image_data_url, foreground_occlusion_mask
|
| 26 |
from services.pipeline.bundle_assembly import build_fallback_segments, build_floor_segment, build_wall_segment
|
| 27 |
from services.pipeline import debug_stages
|
|
@@ -214,6 +223,14 @@ def build_segmentation_bundle(contents: bytes, debug: PipelineDebugCapture | Non
|
|
| 214 |
if lighting_maps and lighting_maps.get("shadeMap") is not None:
|
| 215 |
from config.models import INTRINSIC_MODEL_VERSION
|
| 216 |
lighting_source, intrinsic_lighting_used = f"intrinsic-{INTRINSIC_MODEL_VERSION}", True
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 217 |
if ENABLE_SHADING_TRANSFER and (not lighting_maps or lighting_maps.get("shadeMap") is None):
|
| 218 |
lighting_maps = build_luminance_lighting_maps(img_np, surface_mask, replaced_material_mask)
|
| 219 |
if lighting_maps and lighting_maps.get("shadeMap") is not None:
|
|
@@ -222,7 +239,10 @@ def build_segmentation_bundle(contents: bytes, debug: PipelineDebugCapture | Non
|
|
| 222 |
shade_map, showroom_shade_map, reflection_map = lighting_maps.get("shadeMap"), lighting_maps.get("showroomShadeMap"), lighting_maps.get("reflectionMap")
|
| 223 |
shade_statistics = lighting_map_statistics(shade_map, surface_mask)
|
| 224 |
el = (time.perf_counter() - t0) * 1000
|
| 225 |
-
|
|
|
|
|
|
|
|
|
|
| 226 |
if d:
|
| 227 |
debug_stages.record_lighting(d, shade_map, showroom_shade_map, reflection_map, surface_mask, lighting_source, el)
|
| 228 |
|
|
|
|
| 9 |
import numpy as np
|
| 10 |
from PIL import Image
|
| 11 |
|
| 12 |
+
from config.runtime import (
|
| 13 |
+
ENABLE_FAST_SHADOW_TRANSFER,
|
| 14 |
+
ENABLE_INTRINSIC_SHADING,
|
| 15 |
+
ENABLE_SHADING_TRANSFER,
|
| 16 |
+
ENABLE_WALL_SEGMENTS,
|
| 17 |
+
)
|
| 18 |
from models.depth import estimate_scene_geometry
|
| 19 |
from models.loader import _load_intrinsic_model
|
| 20 |
from models.segmentation import active_model_metadata, run_segmentation
|
|
|
|
| 26 |
from services.geometry.multi_plane import geometry_point_maps
|
| 27 |
from services.geometry.uv_mapping import build_surface_uv_mapping
|
| 28 |
from services.lighting.intrinsic import build_intrinsic_lighting_maps
|
| 29 |
+
from services.lighting.shading import (
|
| 30 |
+
build_fast_shadow_lighting_maps,
|
| 31 |
+
build_luminance_lighting_maps,
|
| 32 |
+
lighting_map_statistics,
|
| 33 |
+
)
|
| 34 |
from services.pipeline.packaging import encode_bundle_image_data_url, foreground_occlusion_mask
|
| 35 |
from services.pipeline.bundle_assembly import build_fallback_segments, build_floor_segment, build_wall_segment
|
| 36 |
from services.pipeline import debug_stages
|
|
|
|
| 223 |
if lighting_maps and lighting_maps.get("shadeMap") is not None:
|
| 224 |
from config.models import INTRINSIC_MODEL_VERSION
|
| 225 |
lighting_source, intrinsic_lighting_used = f"intrinsic-{INTRINSIC_MODEL_VERSION}", True
|
| 226 |
+
if ENABLE_FAST_SHADOW_TRANSFER and (not lighting_maps or lighting_maps.get("shadeMap") is None):
|
| 227 |
+
lighting_maps = build_fast_shadow_lighting_maps(
|
| 228 |
+
img_np,
|
| 229 |
+
surface_mask,
|
| 230 |
+
replaced_material_mask,
|
| 231 |
+
)
|
| 232 |
+
if lighting_maps and lighting_maps.get("shadeMap") is not None:
|
| 233 |
+
lighting_source = "fast-luminance"
|
| 234 |
if ENABLE_SHADING_TRANSFER and (not lighting_maps or lighting_maps.get("shadeMap") is None):
|
| 235 |
lighting_maps = build_luminance_lighting_maps(img_np, surface_mask, replaced_material_mask)
|
| 236 |
if lighting_maps and lighting_maps.get("shadeMap") is not None:
|
|
|
|
| 239 |
shade_map, showroom_shade_map, reflection_map = lighting_maps.get("shadeMap"), lighting_maps.get("showroomShadeMap"), lighting_maps.get("reflectionMap")
|
| 240 |
shade_statistics = lighting_map_statistics(shade_map, surface_mask)
|
| 241 |
el = (time.perf_counter() - t0) * 1000
|
| 242 |
+
lighting_detail = f"source={lighting_source}"
|
| 243 |
+
if shade_map is not None:
|
| 244 |
+
lighting_detail += f" map={shade_map.shape[1]}x{shade_map.shape[0]}"
|
| 245 |
+
_log_stage("Lighting", t0, lighting_detail)
|
| 246 |
if d:
|
| 247 |
debug_stages.record_lighting(d, shade_map, showroom_shade_map, reflection_map, surface_mask, lighting_source, el)
|
| 248 |
|
services/pipeline/bundle_assembly.py
CHANGED
|
@@ -15,6 +15,7 @@ from config.lighting import (
|
|
| 15 |
SHOWROOM_SHADE_MAP_MIN,
|
| 16 |
)
|
| 17 |
from config.runtime import (
|
|
|
|
| 18 |
ENABLE_MULTI_PLANE_SURFACES,
|
| 19 |
ENABLE_PLANE_FIT,
|
| 20 |
ENABLE_SAM_REFINEMENT,
|
|
@@ -100,12 +101,17 @@ def build_floor_segment(
|
|
| 100 |
[p.get("fitMode") for p in surface_mapping["planes"]]
|
| 101 |
if surface_mapping is not None else []
|
| 102 |
),
|
| 103 |
-
"shadingTransferEnabled": ENABLE_SHADING_TRANSFER,
|
|
|
|
| 104 |
"lightingSource": lighting_source,
|
| 105 |
"lightingTransferVersion": LIGHTING_TRANSFER_VERSION,
|
| 106 |
"shadeMapEncoding": SHADE_MAP_ENCODING,
|
| 107 |
"shadeMapStatistics": shade_statistics,
|
| 108 |
"shadeMapRange": [SHADE_MAP_MIN, SHADE_MAP_MAX],
|
|
|
|
|
|
|
|
|
|
|
|
|
| 109 |
"showroomShadeMapRange": [SHOWROOM_SHADE_MAP_MIN, SHOWROOM_SHADE_MAP_MAX],
|
| 110 |
"renderPresetDefaults": {
|
| 111 |
"preset": "realistic",
|
|
|
|
| 15 |
SHOWROOM_SHADE_MAP_MIN,
|
| 16 |
)
|
| 17 |
from config.runtime import (
|
| 18 |
+
ENABLE_FAST_SHADOW_TRANSFER,
|
| 19 |
ENABLE_MULTI_PLANE_SURFACES,
|
| 20 |
ENABLE_PLANE_FIT,
|
| 21 |
ENABLE_SAM_REFINEMENT,
|
|
|
|
| 101 |
[p.get("fitMode") for p in surface_mapping["planes"]]
|
| 102 |
if surface_mapping is not None else []
|
| 103 |
),
|
| 104 |
+
"shadingTransferEnabled": ENABLE_SHADING_TRANSFER or ENABLE_FAST_SHADOW_TRANSFER,
|
| 105 |
+
"fastShadowTransferEnabled": ENABLE_FAST_SHADOW_TRANSFER,
|
| 106 |
"lightingSource": lighting_source,
|
| 107 |
"lightingTransferVersion": LIGHTING_TRANSFER_VERSION,
|
| 108 |
"shadeMapEncoding": SHADE_MAP_ENCODING,
|
| 109 |
"shadeMapStatistics": shade_statistics,
|
| 110 |
"shadeMapRange": [SHADE_MAP_MIN, SHADE_MAP_MAX],
|
| 111 |
+
"shadeMapSize": (
|
| 112 |
+
[int(shade_map.shape[1]), int(shade_map.shape[0])]
|
| 113 |
+
if shade_map is not None else None
|
| 114 |
+
),
|
| 115 |
"showroomShadeMapRange": [SHOWROOM_SHADE_MAP_MIN, SHOWROOM_SHADE_MAP_MAX],
|
| 116 |
"renderPresetDefaults": {
|
| 117 |
"preset": "realistic",
|
test_fast_shadow_transfer.py
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Focused regression checks for the low-cost room-shadow extraction path."""
|
| 2 |
+
|
| 3 |
+
import unittest
|
| 4 |
+
|
| 5 |
+
import numpy as np
|
| 6 |
+
|
| 7 |
+
from config.lighting import SHADE_MAP_MAX, SHADE_MAP_MIN
|
| 8 |
+
from config.runtime import FAST_SHADOW_MAX_DIMENSION
|
| 9 |
+
from services.lighting.luminance import decode_relative_map
|
| 10 |
+
from services.lighting.shading import build_fast_shadow_lighting_maps
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
class FastShadowTransferTests(unittest.TestCase):
|
| 14 |
+
def test_returns_compact_map_that_preserves_a_cast_shadow(self):
|
| 15 |
+
height, width = 1200, 1600
|
| 16 |
+
image = np.full((height, width, 3), 190, dtype=np.uint8)
|
| 17 |
+
image[650:1050, 850:1250] = 70
|
| 18 |
+
mask = np.zeros((height, width), dtype=np.uint8)
|
| 19 |
+
mask[400:1150, 100:1500] = 1
|
| 20 |
+
|
| 21 |
+
result = build_fast_shadow_lighting_maps(image, mask)
|
| 22 |
+
|
| 23 |
+
self.assertIsNotNone(result)
|
| 24 |
+
shade_map = result["shadeMap"]
|
| 25 |
+
self.assertLessEqual(max(shade_map.shape), FAST_SHADOW_MAX_DIMENSION)
|
| 26 |
+
self.assertLess(shade_map.size, height * width)
|
| 27 |
+
decoded = decode_relative_map(shade_map, SHADE_MAP_MIN, SHADE_MAP_MAX)
|
| 28 |
+
shadow = decoded[int(850 * shade_map.shape[0] / height), int(1050 * shade_map.shape[1] / width)]
|
| 29 |
+
lit = decoded[int(850 * shade_map.shape[0] / height), int(450 * shade_map.shape[1] / width)]
|
| 30 |
+
self.assertLess(shadow, lit)
|
| 31 |
+
self.assertIsNone(result["showroomShadeMap"])
|
| 32 |
+
self.assertIsNone(result["reflectionMap"])
|
| 33 |
+
|
| 34 |
+
|
| 35 |
+
if __name__ == "__main__":
|
| 36 |
+
unittest.main()
|
visualizer.gpu.toml
CHANGED
|
@@ -20,6 +20,8 @@ enable_multi_plane_surfaces = true
|
|
| 20 |
enable_wall_segments = false
|
| 21 |
enable_intrinsic_shading = false
|
| 22 |
enable_shading_transfer = false
|
|
|
|
|
|
|
| 23 |
enable_sam_refinement = false
|
| 24 |
enable_floor_mask_cleanup = true
|
| 25 |
warm_start_models = true
|
|
|
|
| 20 |
enable_wall_segments = false
|
| 21 |
enable_intrinsic_shading = false
|
| 22 |
enable_shading_transfer = false
|
| 23 |
+
enable_fast_shadow_transfer = true
|
| 24 |
+
fast_shadow_max_dimension = 640
|
| 25 |
enable_sam_refinement = false
|
| 26 |
enable_floor_mask_cleanup = true
|
| 27 |
warm_start_models = true
|
visualizer.hf.toml
CHANGED
|
@@ -20,6 +20,8 @@ enable_multi_plane_surfaces = true
|
|
| 20 |
enable_wall_segments = false
|
| 21 |
enable_intrinsic_shading = false
|
| 22 |
enable_shading_transfer = false
|
|
|
|
|
|
|
| 23 |
enable_sam_refinement = false
|
| 24 |
enable_floor_mask_cleanup = true
|
| 25 |
debug_artifacts_enabled = false
|
|
|
|
| 20 |
enable_wall_segments = false
|
| 21 |
enable_intrinsic_shading = false
|
| 22 |
enable_shading_transfer = false
|
| 23 |
+
enable_fast_shadow_transfer = true
|
| 24 |
+
fast_shadow_max_dimension = 640
|
| 25 |
enable_sam_refinement = false
|
| 26 |
enable_floor_mask_cleanup = true
|
| 27 |
debug_artifacts_enabled = false
|
visualizer.local.toml
CHANGED
|
@@ -15,7 +15,9 @@ enable_plane_fit = true
|
|
| 15 |
enable_multi_plane_surfaces = true
|
| 16 |
enable_wall_segments = false
|
| 17 |
enable_intrinsic_shading = false
|
| 18 |
-
enable_shading_transfer =
|
|
|
|
|
|
|
| 19 |
enable_sam_refinement = false
|
| 20 |
warm_start_models = true
|
| 21 |
inference_max_dimension = 1024
|
|
|
|
| 15 |
enable_multi_plane_surfaces = true
|
| 16 |
enable_wall_segments = false
|
| 17 |
enable_intrinsic_shading = false
|
| 18 |
+
enable_shading_transfer = false
|
| 19 |
+
enable_fast_shadow_transfer = true
|
| 20 |
+
fast_shadow_max_dimension = 640
|
| 21 |
enable_sam_refinement = false
|
| 22 |
warm_start_models = true
|
| 23 |
inference_max_dimension = 1024
|