Skip to content

Commit

Permalink
Merge pull request #63 from Netflix/dev
Browse files Browse the repository at this point in the history
Merging 1.2
  • Loading branch information
davisadam10 authored Dec 13, 2024
2 parents d7ee6fd + ab33ea2 commit 99f66c7
Show file tree
Hide file tree
Showing 694 changed files with 485,953 additions and 1,547,720 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
*.exr filter=lfs diff=lfs merge=lfs -text
*.tif filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
398 changes: 378 additions & 20 deletions README.md

Large diffs are not rendered by default.

Binary file modified docs/source/images/image11.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/images/image11b.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/source/images/image28.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/source/images/image9.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/images/spg/10_bit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/images/spg/8_bit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/images/spg/Clipping1650.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/images/spg/Clipping_Wrong.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/images/spg/alignment_issue.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/images/spg/exposure_1Stops.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/images/spg/exposure_2Stops.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/images/spg/exposure_3Stops.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/images/spg/real_black_issue_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/images/spg/spg.000000.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/images/spg/spg.000001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/images/spg/spg.000002.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/images/spg/spg.000003.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/images/spg/spg.000004.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/images/spg/spg.000005.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/images/spg/spg.000006.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/images/spg/spg.000007.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/images/spg/spg.000008.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/images/spg/spg.000009.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/images/spg/spg.000010.png
Binary file added docs/source/images/spg/spg.000011.png
Binary file added docs/source/images/spg/spg.000012.png
Binary file added docs/source/images/spg/spg.000013.png
Binary file added docs/source/images/spg/spg.000014.png
Binary file added docs/source/images/spg/spg.000015.png
Binary file added docs/source/images/spg/spg.000016.png
Binary file added docs/source/images/spg/spg.000017.png
Binary file added docs/source/images/spg/spg.000018.png
Binary file added docs/source/images/spg/spg.000019.png
Binary file added docs/source/images/spg/spg.000020.png
Binary file added docs/source/images/spg/spg.000021.png
Binary file added docs/source/images/spg/spg.000022.png
Binary file added docs/source/images/spg/spg.000023.png
Binary file added docs/source/images/spg/spg.000024.png
Binary file added docs/source/images/spg/spg.000025.png
Binary file added docs/source/images/spg/spg.000026.png
Binary file added docs/source/images/spg/spg.000027.png
Binary file added docs/source/images/spg/spg.000028.png
Binary file added docs/source/images/spg/spg.000029.png
Binary file added docs/source/images/spg/spg.000030.png
Binary file added docs/source/images/spg/spg.000031.png
Binary file added docs/source/images/spg/spg.000032.png
Binary file added docs/source/images/spg/spg.000033.png
Binary file added docs/source/images/spg/spg.000034.png
Binary file added docs/source/images/spg/spg.000035.png
Binary file added docs/source/images/spg/spg.000036.png
Binary file added docs/source/images/spg/spg.000037.png
Binary file added docs/source/images/spg/spg.000038.png
Binary file added docs/source/images/spg/spg.000039.png
Binary file added docs/source/images/spg/spg.000040.png
Binary file added docs/source/images/spg/spg.000041.png
Binary file added docs/source/images/spg/spg.000042.png
Binary file added docs/source/images/spg/spg.000043.png
Binary file added docs/source/images/spg/spg.000044.png
Binary file added docs/source/images/spg/spg.000045.png
Binary file added docs/source/images/spg/spg.000046.png
Binary file added docs/source/images/spg/spg.000047.png
Binary file added docs/source/images/spg/spg.000048.png
Binary file added docs/source/images/spg/spg.000049.png
Binary file added docs/source/images/spg/spg.000050.png
Binary file added docs/source/images/spg/spg.000051.png
Binary file added docs/source/images/spg/spg.000052.png
Binary file added docs/source/images/spg/spg.000053.png
Binary file added docs/source/images/spg/spg.000054.png
Binary file added docs/source/images/spg/spg.000055.png
Binary file added docs/source/images/spg/spg.000056.png
Binary file added docs/source/images/spg/spg.000057.png
Binary file added docs/source/images/spg/spg.000058.png
Binary file added docs/source/images/spg/spg.000059.png
Binary file added docs/source/images/spg/spg.000060.png
Binary file added docs/source/images/spg/spg.000061.png
Binary file added docs/source/images/spg/spg.000062.png
Binary file added docs/source/images/spg/spg.000063.png
Binary file added docs/source/images/spg/spg.000064.png
Binary file added docs/source/images/spg/spg.000065.png
Binary file added docs/source/images/spg/spg.000066.png
80 changes: 80 additions & 0 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: OpenVPCal
channels:
- conda-forge
- defaults
- pytorch-nightly
dependencies:
- python=3.11
- conda-forge::openimageio=2.5.9.0
- conda-forge::py-openimageio=2.5.9.0
- pip:
- alabaster==0.7.13
- altgraph==0.17.4
- astroid==3.0.2
- Babel==2.14.0
- certifi==2024.7.4
- charset-normalizer==3.3.2
- colour-checker-detection==0.1.5
- colour-science==0.4.3
- contourpy==1.2.0
- coverage==7.3.3
- cycler==0.12.1
- dill==0.3.7
- docutils==0.20.1
- execnet==2.0.2
- flake8==6.1.0
- fonttools==4.46.0
- idna==3.7
- imageio==2.33.1
- imagesize==1.4.1
- importlib-resources==6.1.1
- iniconfig==2.0.0
- isort==5.13.2
- Jinja2==3.1.4
- kiwisolver==1.4.5
- lazy-object-proxy==1.9.0
- macholib==1.16.3
- MarkupSafe==2.1.3
- matplotlib==3.8.2
- mccabe==0.7.0
- numpy==1.26.2
- opencolorio==2.3.1
- opencv-python==4.8.1.78
- packaging==23.2
- pillow==10.3.0
- platformdirs==4.1.0
- pluggy==1.3.0
- pycodestyle==2.11.1
- pyflakes==3.1.0
- Pygments==2.17.2
- pyinstaller==6.3.0
- pyinstaller-hooks-contrib==2023.10
- pylint==3.0.3
- pyparsing==3.1.1
- pyqtgraph==0.13.3
- PySide6==6.5.3
- PySide6-Addons==6.5.3
- PySide6-Essentials==6.5.3
- pytest==7.4.3
- pytest-xdist==3.5.0
- python-dateutil==2.8.2
- requests==2.32.0
- scipy==1.11.4
- shiboken6==6.5.3
- six==1.16.0
- snowballstemmer==2.2.0
- Sphinx==7.2.6
- sphinx-rtd-theme==2.0.0
- sphinxcontrib-applehelp==1.0.7
- sphinxcontrib-devhelp==1.0.5
- sphinxcontrib-htmlhelp==2.0.4
- sphinxcontrib-jquery==4.1
- sphinxcontrib-jsmath==1.0.1
- sphinxcontrib-qthelp==1.0.6
- sphinxcontrib-serializinghtml==1.1.9
- tomli==2.0.1
- tomlkit==0.12.3
- typing_extensions==4.9.0
- urllib3==2.2.2
- wrapt==1.16.0
- zipp==3.19.1
2 changes: 1 addition & 1 deletion src/open_vp_cal/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
Init Module defines a few module level variables
"""
__version__ = "1.1.0"
__version__ = "1.2.0"
__authors__ = [
"Adam Davis", "Adrian Pueyo", "Carol Payne", "Francesco Luigi Giardiello", "Daniel Heckenberg"
]
Expand Down
126 changes: 10 additions & 116 deletions src/open_vp_cal/application_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,19 @@
application to perform the analysis, calibration and export of the LED walls. This class is inherited by the UI and
CLI classes which implement the methods to display the results to the user.
"""
import json
import os
import tempfile
from typing import List, Dict, Tuple, Any

from open_vp_cal.core import constants, utils
from open_vp_cal.core.resource_loader import ResourceLoader
from open_vp_cal.core.structures import OpenVPCalWarning, OpenVPCalException
from open_vp_cal.framework.configuraton import Configuration
from open_vp_cal.framework.processing import Processing, SeparationException
from open_vp_cal.framework.utils import export_pre_calibration_ocio_config, generate_patterns_for_led_walls
from open_vp_cal.framework.utils import (generate_patterns_for_led_walls,
generate_spg_patterns_for_led_walls)
from open_vp_cal.framework.validation import Validation
from open_vp_cal.led_wall_settings import LedWallSettings
from open_vp_cal.project_settings import ProjectSettings

from spg.projectSettings import ProjectSettings as SPGProjectSettings
from spg.main import run_spg_pattern_generator
from stageassets.ledWall import LEDWall as SPGLedWall
from stageassets.ledPanel import LEDPanel as SPGLedPanel
from stageassets.rasterMap import RasterMap as SPGRasterMap
from stageassets.rasterMap import Mapping as SPGMapping


class OpenVPCalBase:
"""
Expand Down Expand Up @@ -216,6 +208,12 @@ def analyse(self, led_walls: List[LedWallSettings]) -> bool:
except SeparationException as e:
self.error_message(f"{led_wall.name}\n{e}")
return False
except OpenVPCalException as e:
self.error_message(f"{led_wall.name}\n{e}")
return False
except OpenVPCalWarning as e:
self.error_message(f"{led_wall.name}\n{e}")
return True
return True

def calibrate(self, led_walls: List[LedWallSettings]) -> bool:
Expand Down Expand Up @@ -353,108 +351,4 @@ def generate_spg_patterns_for_led_walls(
led_walls: the led walls we want to generate patterns from
"""

config_writer, ocio_config_path = export_pre_calibration_ocio_config(project_settings, led_walls)
spg_project_settings = SPGProjectSettings()
spg_project_settings.frame_rate = project_settings.frame_rate
spg_project_settings.image_file_format = project_settings.file_format
spg_project_settings.image_file_bit_depth = 10
spg_project_settings.output_folder = os.path.join(
project_settings.export_folder,
constants.ProjectFolders.SPG
)
spg_project_settings.channel_mapping = "RGB"
spg_project_settings.ocio_config_path = ocio_config_path
apply_eotf_colour_transform = False
if spg_project_settings.image_file_format != constants.FileFormats.FF_EXR:
apply_eotf_colour_transform = True

spg_led_walls = []
spg_led_panels = []
spg_raster_maps = []

for count, led_wall in enumerate(led_walls):
idx = count + 1

# As this is a basic setup we default to a typical panel as we are not doing a deep dive and pixel perfect
# match
spg_panel = SPGLedPanel()
spg_panel.name = f"Panel_{idx}_{led_wall.name}"
spg_panel.manufacturer = "Unknown"
spg_panel.panel_width = 500
spg_panel.panel_height = 500
spg_panel.panel_depth = 80
spg_panel.pixel_pitch = 2.85
spg_panel.brightness = led_wall.target_max_lum_nits
spg_panel.refresh_rate = "3840"
spg_panel.scan_rate = "1/8"
spg_led_panels.append(spg_panel)

# We create a faux led wall which is the largest which we can fit into a given resolution image
# as we are not doing a pixel perfect diagnosis
target_gamut_only_cs = config_writer.get_target_gamut_only_cs(led_wall)
target_gamut_and_tf_cs = config_writer.get_target_gamut_and_transfer_function_cs(led_wall)
transfer_function_only_cs = config_writer.get_transfer_function_only_cs(led_wall)

# If we are not using an EXR file format, we apply the EOTF colour transform
if not apply_eotf_colour_transform:
target_gamut_and_tf_cs = target_gamut_only_cs

spg_led_wall = SPGLedWall()
spg_led_wall.gamut_only_cs_name = target_gamut_only_cs.getName()
spg_led_wall.gamut_and_transfer_function_cs_name = target_gamut_and_tf_cs.getName()
spg_led_wall.transfer_function_only_cs_name = transfer_function_only_cs.getName()
spg_led_wall.id = idx
spg_led_wall.name = led_wall.name
spg_led_wall.panel_name = spg_panel.name
spg_led_wall.panel = spg_panel
spg_led_wall.panel_count_width = int(project_settings.resolution_width / spg_panel.panel_resolution_width)
spg_led_wall.panel_count_height = int(
project_settings.resolution_height / spg_panel.panel_resolution_height
)
spg_led_wall.wall_default_color = utils.generate_color(led_wall.name)

spg_led_walls.append(spg_led_wall)

spg_mapping = SPGMapping()
spg_mapping.wall_name = spg_led_wall.name
spg_mapping.raster_u = 0
spg_mapping.raster_v = 0
spg_mapping.wall_segment_u_start = 0
spg_mapping.wall_segment_u_end = spg_led_wall.resolution_width
spg_mapping.wall_segment_v_start = 0
spg_mapping.wall_segment_v_end = spg_led_wall.resolution_height
spg_mapping.wall_segment_orientation = 0

spg_raster_map = SPGRasterMap()
spg_raster_map.name = f"Raster_{led_wall.name}"
spg_raster_map.resolution_width = project_settings.resolution_width
spg_raster_map.resolution_height = project_settings.resolution_height
spg_raster_map.mappings = [spg_mapping]

spg_raster_maps.append(spg_raster_map)

spg_led_panel_json = [json.loads(spg_led_panel.to_json()) for spg_led_panel in spg_led_panels]
spg_led_wall_json = [json.loads(spg_led_wall.to_json()) for spg_led_wall in spg_led_walls]
spg_raster_map_json = [json.loads(spg_raster_map.to_json()) for spg_raster_map in spg_raster_maps]

tmp_dir = tempfile.TemporaryDirectory()
spg_led_panel_json_file = os.path.join(tmp_dir.name, "led_panel_settings.json")
spg_led_wall_json_file = os.path.join(tmp_dir.name, "led_wall_settings.json")
spg_raster_map_json_file = os.path.join(tmp_dir.name, "raster_map_settings.json")
spg_project_settings_json_file = os.path.join(tmp_dir.name, "spg_project_settings.json")

with open(spg_led_panel_json_file, 'w') as f:
json.dump(spg_led_panel_json, f, indent=4)
with open(spg_led_wall_json_file, 'w') as f:
json.dump(spg_led_wall_json, f, indent=4)
with open(spg_raster_map_json_file, 'w') as f:
json.dump(spg_raster_map_json, f, indent=4)
with open(spg_project_settings_json_file, 'w') as f:
json.dump(json.loads(spg_project_settings.to_json()), f, indent=4)

run_spg_pattern_generator(
spg_led_panel_json_file,
spg_led_wall_json_file,
spg_raster_map_json_file,
spg_project_settings_json_file,
ResourceLoader.spg_pattern_basic_config())
generate_spg_patterns_for_led_walls(project_settings, led_walls)
Loading

0 comments on commit 99f66c7

Please sign in to comment.