Compare commits
9 Commits
Author | SHA1 | Date | |
---|---|---|---|
8602978a0a | |||
4c4a12d1dc | |||
a32b7586d8 | |||
d27d3d0653 | |||
69f76e6164 | |||
|
ee38e3fbd9 | ||
|
1d88a0b929 | ||
|
d77f708dc2 | ||
|
358ae81525 |
@ -1,6 +1,6 @@
|
|||||||
# Image-Generator
|
# Image-Generator
|
||||||
|
|
||||||
A CLI to generate comparison image sets with
|
A CLI to generate comparison image sets utilizing the power of VapourSynth
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
|
22
build.py
22
build.py
@ -1,5 +1,5 @@
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from subprocess import run
|
from subprocess import run, PIPE
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
import sys
|
import sys
|
||||||
@ -31,11 +31,23 @@ def build_app():
|
|||||||
icon_path = project_root / "images" / "icon.ico"
|
icon_path = project_root / "images" / "icon.ico"
|
||||||
additional_hooks_path = Path(Path.cwd() / "hooks")
|
additional_hooks_path = Path(Path.cwd() / "hooks")
|
||||||
|
|
||||||
# paths to needed vapoursynth files
|
# get poetry venv path
|
||||||
vapoursynth_64 = project_root / ".venv" / "Lib" / "site-packages" / "vapoursynth64"
|
poetry_venv_path = run(
|
||||||
vapoursynth_64_portable = (
|
["cmd", "/c", "poetry", "env", "info", "--path"],
|
||||||
project_root / ".venv" / "Lib" / "site-packages" / "portable.vs"
|
stdout=PIPE,
|
||||||
|
stderr=PIPE,
|
||||||
|
text=True,
|
||||||
|
check=True,
|
||||||
)
|
)
|
||||||
|
if poetry_venv_path.returncode == 0 and poetry_venv_path.stdout:
|
||||||
|
poetry_venv_path = Path(poetry_venv_path.stdout.strip())
|
||||||
|
site_packages = poetry_venv_path / "Lib" / "site-packages"
|
||||||
|
|
||||||
|
# get paths to needed vapoursynth files in poetry venv
|
||||||
|
vapoursynth_64 = site_packages / "vapoursynth64"
|
||||||
|
vapoursynth_64_portable = site_packages / "portable.vs"
|
||||||
|
else:
|
||||||
|
raise FileNotFoundError("Cannot find path to poetry venv")
|
||||||
|
|
||||||
# Change directory so PyInstaller outputs all of its files in its own folder
|
# Change directory so PyInstaller outputs all of its files in its own folder
|
||||||
os.chdir(pyinstaller_folder)
|
os.chdir(pyinstaller_folder)
|
||||||
|
@ -7,7 +7,7 @@ from frame_forge.cli_utils import frame_list
|
|||||||
|
|
||||||
|
|
||||||
program_name = "FrameForge"
|
program_name = "FrameForge"
|
||||||
__version__ = "1.3.0"
|
__version__ = "1.3.3"
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
@ -398,7 +398,10 @@ class GenerateImages:
|
|||||||
)
|
)
|
||||||
|
|
||||||
if image_output_dir.exists():
|
if image_output_dir.exists():
|
||||||
shutil.rmtree(image_output_dir, ignore_errors=True)
|
for folder in ("img_comparison", "img_selected", "img_sync"):
|
||||||
|
rm_path = image_output_dir / folder
|
||||||
|
if rm_path.is_dir() and rm_path.exists():
|
||||||
|
shutil.rmtree(rm_path, ignore_errors=True)
|
||||||
|
|
||||||
image_output_dir.mkdir(exist_ok=True, parents=True)
|
image_output_dir.mkdir(exist_ok=True, parents=True)
|
||||||
|
|
||||||
@ -465,9 +468,11 @@ class GenerateImages:
|
|||||||
)
|
)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
pict_types = ("B", b"B")
|
||||||
for i, frame in enumerate(b_frames):
|
for i, frame in enumerate(b_frames):
|
||||||
while (
|
while (
|
||||||
self.encode_node.get_frame(frame).props["_PictType"].decode() != "B"
|
self.encode_node.get_frame(frame).props["_PictType"]
|
||||||
|
not in pict_types
|
||||||
):
|
):
|
||||||
frame += 1
|
frame += 1
|
||||||
b_frames[i] = frame
|
b_frames[i] = frame
|
||||||
@ -686,7 +691,7 @@ class GenerateImages:
|
|||||||
self.source_index_path = Path(self.source_index_path)
|
self.source_index_path = Path(self.source_index_path)
|
||||||
|
|
||||||
if not self.encode_index_path or not Path(self.encode_index_path).exists():
|
if not self.encode_index_path or not Path(self.encode_index_path).exists():
|
||||||
encode_path_obj = Path(self.source_file)
|
encode_path_obj = Path(self.encode_file)
|
||||||
self.encode_index_path = encode_path_obj.parent / Path(
|
self.encode_index_path = encode_path_obj.parent / Path(
|
||||||
f"{encode_path_obj.stem}{indexer_ext}"
|
f"{encode_path_obj.stem}{indexer_ext}"
|
||||||
)
|
)
|
||||||
|
@ -22,6 +22,7 @@ hiddenimports = [
|
|||||||
"collections.namedtuple",
|
"collections.namedtuple",
|
||||||
"collections.abc.Iterable",
|
"collections.abc.Iterable",
|
||||||
"collections.abc.Mapping",
|
"collections.abc.Mapping",
|
||||||
|
"concurrent.futures",
|
||||||
"concurrent.futures.Future",
|
"concurrent.futures.Future",
|
||||||
"fractions",
|
"fractions",
|
||||||
]
|
]
|
||||||
|
38
poetry.lock
generated
38
poetry.lock
generated
@ -1,4 +1,4 @@
|
|||||||
# This file is automatically @generated by Poetry 1.6.1 and should not be changed by hand.
|
# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand.
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "altgraph"
|
name = "altgraph"
|
||||||
@ -17,10 +17,8 @@ version = "1.3.4"
|
|||||||
description = "awesome VapourSynth functions"
|
description = "awesome VapourSynth functions"
|
||||||
optional = false
|
optional = false
|
||||||
python-versions = ">=3.9"
|
python-versions = ">=3.9"
|
||||||
files = [
|
files = []
|
||||||
{file = "awsmfunc-1.3.4-py3-none-any.whl", hash = "sha256:d9ce9cf90dfdb66b4561a5d3b011232e663ad0d879e2a276827bff9b8b3b37e1"},
|
develop = false
|
||||||
{file = "awsmfunc-1.3.4.tar.gz", hash = "sha256:8330332f5c4818322b4090b24499b1dc4e4e371460de70c4bd62a112f4157255"},
|
|
||||||
]
|
|
||||||
|
|
||||||
[package.dependencies]
|
[package.dependencies]
|
||||||
numpy = "*"
|
numpy = "*"
|
||||||
@ -29,7 +27,13 @@ vs-rekt = ">=1.0.0"
|
|||||||
vsutil = ">=0.7.0"
|
vsutil = ">=0.7.0"
|
||||||
|
|
||||||
[package.extras]
|
[package.extras]
|
||||||
dev = ["pylint", "toml", "yapf"]
|
dev = ["ruff", "toml"]
|
||||||
|
|
||||||
|
[package.source]
|
||||||
|
type = "git"
|
||||||
|
url = "https://github.com/OpusGang/awsmfunc"
|
||||||
|
reference = "HEAD"
|
||||||
|
resolved_reference = "e1290f799162749fc627951290bfb4089f2f39cb"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "black"
|
name = "black"
|
||||||
@ -216,10 +220,10 @@ test = ["appdirs (==1.4.4)", "covdefaults (>=2.3)", "pytest (>=7.4)", "pytest-co
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pyinstaller"
|
name = "pyinstaller"
|
||||||
version = "6.3.0"
|
version = "6.10.0"
|
||||||
description = "PyInstaller bundles a Python application and all its dependencies into a single package."
|
description = "PyInstaller bundles a Python application and all its dependencies into a single package."
|
||||||
optional = false
|
optional = false
|
||||||
python-versions = "<3.13,>=3.8"
|
python-versions = "<3.14,>=3.8"
|
||||||
files = []
|
files = []
|
||||||
develop = true
|
develop = true
|
||||||
|
|
||||||
@ -228,7 +232,7 @@ altgraph = "*"
|
|||||||
macholib = {version = ">=1.8", markers = "sys_platform == \"darwin\""}
|
macholib = {version = ">=1.8", markers = "sys_platform == \"darwin\""}
|
||||||
packaging = ">=22.0"
|
packaging = ">=22.0"
|
||||||
pefile = {version = ">=2022.5.30", markers = "sys_platform == \"win32\""}
|
pefile = {version = ">=2022.5.30", markers = "sys_platform == \"win32\""}
|
||||||
pyinstaller-hooks-contrib = ">=2021.4"
|
pyinstaller-hooks-contrib = ">=2024.8"
|
||||||
pywin32-ctypes = {version = ">=0.2.1", markers = "sys_platform == \"win32\""}
|
pywin32-ctypes = {version = ">=0.2.1", markers = "sys_platform == \"win32\""}
|
||||||
setuptools = ">=42.0.0"
|
setuptools = ">=42.0.0"
|
||||||
|
|
||||||
@ -242,15 +246,19 @@ url = "custom-pyinstaller"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pyinstaller-hooks-contrib"
|
name = "pyinstaller-hooks-contrib"
|
||||||
version = "2023.11"
|
version = "2024.8"
|
||||||
description = "Community maintained hooks for PyInstaller"
|
description = "Community maintained hooks for PyInstaller"
|
||||||
optional = false
|
optional = false
|
||||||
python-versions = ">=3.7"
|
python-versions = ">=3.8"
|
||||||
files = [
|
files = [
|
||||||
{file = "pyinstaller-hooks-contrib-2023.11.tar.gz", hash = "sha256:5dd7a8a054a65c19cdaa381cabcfbe76f44d5f88d18214b0c570a0cd139be77f"},
|
{file = "pyinstaller_hooks_contrib-2024.8-py3-none-any.whl", hash = "sha256:0057fe9a5c398d3f580e73e58793a1d4a8315ca91c3df01efea1c14ed557825a"},
|
||||||
{file = "pyinstaller_hooks_contrib-2023.11-py2.py3-none-any.whl", hash = "sha256:f2a75dac2968ec81f92dcd3768906f654fa4204bc496126ae8483e87a5d89602"},
|
{file = "pyinstaller_hooks_contrib-2024.8.tar.gz", hash = "sha256:29b68d878ab739e967055b56a93eb9b58e529d5b054fbab7a2f2bacf80cef3e2"},
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[package.dependencies]
|
||||||
|
packaging = ">=22.0"
|
||||||
|
setuptools = ">=42.0.0"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pywin32-ctypes"
|
name = "pywin32-ctypes"
|
||||||
version = "0.2.2"
|
version = "0.2.2"
|
||||||
@ -334,5 +342,5 @@ vapoursynth = "*"
|
|||||||
|
|
||||||
[metadata]
|
[metadata]
|
||||||
lock-version = "2.0"
|
lock-version = "2.0"
|
||||||
python-versions = "3.11.5"
|
python-versions = "3.11.9"
|
||||||
content-hash = "4425fd0e4eb9ee21b1b0d79c3824a831cdbe45b6733c9477065c8cdd265731a8"
|
content-hash = "42cace5dbe92132d04512c3dbc5a60c1cb06fa883a7030eb74f8f0e782b48226"
|
||||||
|
@ -1,16 +1,17 @@
|
|||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = "frame-forge"
|
name = "frame-forge"
|
||||||
version = "1.0.3"
|
version = "1.3.3"
|
||||||
description = "CLI to offload image generation to"
|
description = "CLI to offload image generation to"
|
||||||
authors = ["jlw4049 <jlw_4049@hotmail.com>"]
|
authors = ["jlw4049 <jlw_4049@hotmail.com>"]
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
|
package-mode = false
|
||||||
|
|
||||||
[tool.poetry.dependencies]
|
[tool.poetry.dependencies]
|
||||||
python = "3.11.5"
|
python = "3.11.9"
|
||||||
vapoursynth-portable = "65"
|
|
||||||
numpy = "^1.26.2"
|
numpy = "^1.26.2"
|
||||||
awsmfunc = "^1.3.4"
|
vapoursynth-portable = "65"
|
||||||
|
awsmfunc = {git = "https://github.com/OpusGang/awsmfunc"}
|
||||||
|
|
||||||
|
|
||||||
[tool.poetry.group.dev.dependencies]
|
[tool.poetry.group.dev.dependencies]
|
||||||
|
Loading…
Reference in New Issue
Block a user