euler-preprocess 2.0.0__tar.gz → 2.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. {euler_preprocess-2.0.0 → euler_preprocess-2.1.0}/PKG-INFO +1 -1
  2. {euler_preprocess-2.0.0 → euler_preprocess-2.1.0}/euler_preprocess/common/output.py +21 -3
  3. {euler_preprocess-2.0.0 → euler_preprocess-2.1.0}/euler_preprocess.egg-info/PKG-INFO +1 -1
  4. {euler_preprocess-2.0.0 → euler_preprocess-2.1.0}/pyproject.toml +1 -1
  5. {euler_preprocess-2.0.0 → euler_preprocess-2.1.0}/tests/test_fog_aux_outputs.py +70 -0
  6. {euler_preprocess-2.0.0 → euler_preprocess-2.1.0}/README.md +0 -0
  7. {euler_preprocess-2.0.0 → euler_preprocess-2.1.0}/euler_preprocess/__init__.py +0 -0
  8. {euler_preprocess-2.0.0 → euler_preprocess-2.1.0}/euler_preprocess/cli.py +0 -0
  9. {euler_preprocess-2.0.0 → euler_preprocess-2.1.0}/euler_preprocess/common/__init__.py +0 -0
  10. {euler_preprocess-2.0.0 → euler_preprocess-2.1.0}/euler_preprocess/common/dataset.py +0 -0
  11. {euler_preprocess-2.0.0 → euler_preprocess-2.1.0}/euler_preprocess/common/device.py +0 -0
  12. {euler_preprocess-2.0.0 → euler_preprocess-2.1.0}/euler_preprocess/common/intrinsics.py +0 -0
  13. {euler_preprocess-2.0.0 → euler_preprocess-2.1.0}/euler_preprocess/common/io.py +0 -0
  14. {euler_preprocess-2.0.0 → euler_preprocess-2.1.0}/euler_preprocess/common/logging.py +0 -0
  15. {euler_preprocess-2.0.0 → euler_preprocess-2.1.0}/euler_preprocess/common/noise.py +0 -0
  16. {euler_preprocess-2.0.0 → euler_preprocess-2.1.0}/euler_preprocess/common/normalize.py +0 -0
  17. {euler_preprocess-2.0.0 → euler_preprocess-2.1.0}/euler_preprocess/common/sampling.py +0 -0
  18. {euler_preprocess-2.0.0 → euler_preprocess-2.1.0}/euler_preprocess/common/transform.py +0 -0
  19. {euler_preprocess-2.0.0 → euler_preprocess-2.1.0}/euler_preprocess/fog/__init__.py +0 -0
  20. {euler_preprocess-2.0.0 → euler_preprocess-2.1.0}/euler_preprocess/fog/airlight_from_sky.py +0 -0
  21. {euler_preprocess-2.0.0 → euler_preprocess-2.1.0}/euler_preprocess/fog/dcp_airlight.py +0 -0
  22. {euler_preprocess-2.0.0 → euler_preprocess-2.1.0}/euler_preprocess/fog/dcp_airlight_torch.py +0 -0
  23. {euler_preprocess-2.0.0 → euler_preprocess-2.1.0}/euler_preprocess/fog/dcp_heuristic_airlight.py +0 -0
  24. {euler_preprocess-2.0.0 → euler_preprocess-2.1.0}/euler_preprocess/fog/dcp_heuristic_airlight_torch.py +0 -0
  25. {euler_preprocess-2.0.0 → euler_preprocess-2.1.0}/euler_preprocess/fog/foggify.py +0 -0
  26. {euler_preprocess-2.0.0 → euler_preprocess-2.1.0}/euler_preprocess/fog/foggify_logging.py +0 -0
  27. {euler_preprocess-2.0.0 → euler_preprocess-2.1.0}/euler_preprocess/fog/logging.py +0 -0
  28. {euler_preprocess-2.0.0 → euler_preprocess-2.1.0}/euler_preprocess/fog/models.py +0 -0
  29. {euler_preprocess-2.0.0 → euler_preprocess-2.1.0}/euler_preprocess/fog/transform.py +0 -0
  30. {euler_preprocess-2.0.0 → euler_preprocess-2.1.0}/euler_preprocess/radial/__init__.py +0 -0
  31. {euler_preprocess-2.0.0 → euler_preprocess-2.1.0}/euler_preprocess/radial/transform.py +0 -0
  32. {euler_preprocess-2.0.0 → euler_preprocess-2.1.0}/euler_preprocess/sky_depth/__init__.py +0 -0
  33. {euler_preprocess-2.0.0 → euler_preprocess-2.1.0}/euler_preprocess/sky_depth/transform.py +0 -0
  34. {euler_preprocess-2.0.0 → euler_preprocess-2.1.0}/euler_preprocess.egg-info/SOURCES.txt +0 -0
  35. {euler_preprocess-2.0.0 → euler_preprocess-2.1.0}/euler_preprocess.egg-info/dependency_links.txt +0 -0
  36. {euler_preprocess-2.0.0 → euler_preprocess-2.1.0}/euler_preprocess.egg-info/entry_points.txt +0 -0
  37. {euler_preprocess-2.0.0 → euler_preprocess-2.1.0}/euler_preprocess.egg-info/requires.txt +0 -0
  38. {euler_preprocess-2.0.0 → euler_preprocess-2.1.0}/euler_preprocess.egg-info/top_level.txt +0 -0
  39. {euler_preprocess-2.0.0 → euler_preprocess-2.1.0}/setup.cfg +0 -0
  40. {euler_preprocess-2.0.0 → euler_preprocess-2.1.0}/tests/test_airlight_fallback.py +0 -0
  41. {euler_preprocess-2.0.0 → euler_preprocess-2.1.0}/tests/test_dcp_heuristic_airlight.py +0 -0
  42. {euler_preprocess-2.0.0 → euler_preprocess-2.1.0}/tests/test_foggify_integration.py +0 -0
  43. {euler_preprocess-2.0.0 → euler_preprocess-2.1.0}/tests/test_radial.py +0 -0
  44. {euler_preprocess-2.0.0 → euler_preprocess-2.1.0}/tests/test_sky_depth.py +0 -0
  45. {euler_preprocess-2.0.0 → euler_preprocess-2.1.0}/tests/test_source_backed_output.py +0 -0
  46. {euler_preprocess-2.0.0 → euler_preprocess-2.1.0}/tests/test_zip_output.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: euler-preprocess
3
- Version: 2.0.0
3
+ Version: 2.1.0
4
4
  Summary: Physics-based preprocessing (fog, etc.) for RGB+depth datasets
5
5
  Requires-Python: >=3.9
6
6
  Description-Content-Type: text/markdown
@@ -381,11 +381,29 @@ def _select_pipeline_target(
381
381
  f"pipeline.output_targets does not contain slot '{slot}'"
382
382
  )
383
383
 
384
- if len(pipeline.output_targets) == 1:
385
- return pipeline.output_targets[0]
384
+ # Auxiliary slot names declared by the transform are reserved for
385
+ # OUTPUT_SLOT_SPECS and routed by prepare_output_backends; ignore them
386
+ # when picking the *primary* target. This lets pipeline configs use
387
+ # arbitrary slot aliases (e.g. ``"fog"`` for the primary RGB output)
388
+ # alongside named auxiliary outputs.
389
+ aux_slots = set((getattr(transform_class, "OUTPUT_SLOT_SPECS", None) or {}).keys())
390
+ primary_candidates = [
391
+ t for t in pipeline.output_targets if t.slot not in aux_slots
392
+ ]
393
+
394
+ if len(primary_candidates) == 1:
395
+ return primary_candidates[0]
396
+
397
+ if not primary_candidates:
398
+ raise ValueError(
399
+ f"pipeline.output_targets has no primary target for "
400
+ f"{transform_class.__name__}; only auxiliary slots present "
401
+ f"({sorted(aux_slots)}). Add a target for the primary output."
402
+ )
386
403
 
387
404
  raise ValueError(
388
- "pipeline.output_targets contains multiple entries; set top-level "
405
+ "pipeline.output_targets contains multiple primary entries "
406
+ f"({[t.slot for t in primary_candidates]}); set top-level "
389
407
  "'output_slot' to select the target for this transform."
390
408
  )
391
409
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: euler-preprocess
3
- Version: 2.0.0
3
+ Version: 2.1.0
4
4
  Summary: Physics-based preprocessing (fog, etc.) for RGB+depth datasets
5
5
  Requires-Python: >=3.9
6
6
  Description-Content-Type: text/markdown
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "euler-preprocess"
3
- version = "2.0.0"
3
+ version = "2.1.0"
4
4
  description = "Physics-based preprocessing (fog, etc.) for RGB+depth datasets"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.9"
@@ -331,6 +331,76 @@ def test_aux_outputs_carry_correct_index_metadata(tmp_path: Path) -> None:
331
331
  assert airlight_index["euler_train"]["used_as"] == "target"
332
332
 
333
333
 
334
+ def test_primary_slot_auto_selected_when_aliased(tmp_path: Path) -> None:
335
+ """A pipeline target whose slot is *not* one of the aux slot names is
336
+ automatically picked up as the primary RGB target — even when its slot
337
+ name doesn't match the transform's primary slot (e.g. ``"fog"``).
338
+ """
339
+ dataset = _make_dataset(tmp_path)
340
+ pipeline_root = tmp_path / "pipeline_root_alias"
341
+ manifest_path = pipeline_root / ".euler_pipeline" / "pipeline_outputs.json"
342
+ config = {
343
+ "pipeline": {
344
+ "output_root": str(pipeline_root),
345
+ "outputs_manifest_path": str(manifest_path),
346
+ "output_targets": [
347
+ {
348
+ "slot": "fog",
349
+ "datasetType": "rgb",
350
+ "relativePath": "foggy_rgb.zip",
351
+ "path": str(pipeline_root / "foggy_rgb.zip"),
352
+ "storage": "zip",
353
+ },
354
+ {
355
+ "slot": ATMOSPHERIC_LIGHT_SLOT,
356
+ "datasetType": "rgb",
357
+ "relativePath": "atmospheric_light.zip",
358
+ "path": str(pipeline_root / "atmospheric_light.zip"),
359
+ "storage": "zip",
360
+ },
361
+ {
362
+ "slot": SCATTERING_COEFFICIENT_SLOT,
363
+ "datasetType": "rgb",
364
+ "relativePath": "scattering_coefficient.zip",
365
+ "path": str(pipeline_root / "scattering_coefficient.zip"),
366
+ "storage": "zip",
367
+ },
368
+ ],
369
+ }
370
+ }
371
+
372
+ backends = prepare_output_backends(config, dataset, FogTransform)
373
+
374
+ assert set(backends.keys()) == {
375
+ "rgb",
376
+ SCATTERING_COEFFICIENT_SLOT,
377
+ ATMOSPHERIC_LIGHT_SLOT,
378
+ }
379
+ # Primary backend points at the "fog" target, not a literal "rgb" target.
380
+ assert backends["rgb"].root == pipeline_root / "foggy_rgb.zip"
381
+
382
+ transform = FogTransform(
383
+ config_path=str(_write_fog_config(tmp_path / "fog_cfg.json")),
384
+ out_path=str(backends["rgb"].root),
385
+ output_backends=backends,
386
+ )
387
+ transform.run(dataset)
388
+
389
+ import zipfile
390
+
391
+ with zipfile.ZipFile(pipeline_root / "foggy_rgb.zip", "r") as zf:
392
+ assert "Scene01/Camera_0/00001.png" in zf.namelist()
393
+ with zipfile.ZipFile(pipeline_root / "scattering_coefficient.zip", "r") as zf:
394
+ assert "Scene01/Camera_0/00001.npy" in zf.namelist()
395
+ with zipfile.ZipFile(pipeline_root / "atmospheric_light.zip", "r") as zf:
396
+ assert "Scene01/Camera_0/00001.npy" in zf.namelist()
397
+
398
+ # Manifest still lists every active slot in declaration order.
399
+ manifest = json.loads(manifest_path.read_text())
400
+ slots = [target["slot"] for target in manifest["outputs"]]
401
+ assert slots == ["fog", SCATTERING_COEFFICIENT_SLOT, ATMOSPHERIC_LIGHT_SLOT]
402
+
403
+
334
404
  def test_apply_model_returns_full_size_maps_for_uniform() -> None:
335
405
  """Sanity-check the broadcast logic on the model layer."""
336
406
  from euler_preprocess.fog.models import apply_model