Skip to content

Commit

Permalink
Merge pull request #199 from pytti-tools/fix_show_palette
Browse files Browse the repository at this point in the history
Fix show palette
  • Loading branch information
dmarx authored Jun 11, 2022
2 parents cff11c3 + f35a07e commit c4c56f4
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/pytti/update_func.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
freeze_vram_usage,
)

from pytti.image_models.pixel import PixelImage

from pytti.Transforms import (
animate_2d,
zoom_2d,
Expand Down
32 changes: 32 additions & 0 deletions tests/test_show_palette.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import pytest

from hydra import initialize, compose
from loguru import logger
from pytti.workhorse import _main as render_frames
from omegaconf import OmegaConf, open_dict


CONFIG_BASE_PATH = "config"
CONFIG_DEFAULTS = "default.yaml"


def run_cfg(cfg_str):
with initialize(config_path=CONFIG_BASE_PATH):
cfg_base = compose(
config_name=CONFIG_DEFAULTS,
overrides=[f"conf=_empty"],
)
cfg_this = OmegaConf.create(cfg_str)

with open_dict(cfg_base) as cfg:
cfg = OmegaConf.merge(cfg_base, cfg_this)
render_frames(cfg)


def test_show_palette():
cfg_str = f"""# @package _global_
scenes: a photograph of an apple
image_model: Limited Palette
show_palette: true
"""
run_cfg(cfg_str)

0 comments on commit c4c56f4

Please sign in to comment.