Spaces:
Sleeping
Sleeping
Remove Space-side median from normal output (kept for depth) — user wants raw normals, client-side filter if needed
Browse files
infer.py
CHANGED
|
@@ -258,9 +258,12 @@ def process_single_image(image_path, pipeline, task_name, device,
|
|
| 258 |
process_res=process_res,
|
| 259 |
).images[0]
|
| 260 |
|
| 261 |
-
#
|
| 262 |
-
#
|
| 263 |
-
|
|
|
|
|
|
|
|
|
|
| 264 |
|
| 265 |
if task_name == "depth":
|
| 266 |
output_npy = prediction.mean(axis=-1)
|
|
|
|
| 258 |
process_res=process_res,
|
| 259 |
).images[0]
|
| 260 |
|
| 261 |
+
# NO Space-side median filter on normals — per user decision, normals are
|
| 262 |
+
# returned RAW from the model so any filtering can be tuned client-side
|
| 263 |
+
# (the FLUX 16-px grid is present but normals encode orientation everywhere,
|
| 264 |
+
# so over-filtering softens real edges; better to control it downstream).
|
| 265 |
+
# degrid_median() function is kept in this file in case re-enabling is wanted.
|
| 266 |
+
prediction = np.clip(prediction, 0.0, 1.0).astype(np.float32)
|
| 267 |
|
| 268 |
if task_name == "depth":
|
| 269 |
output_npy = prediction.mean(axis=-1)
|