moved utils to Av1an + refactoring

This commit is contained in:
Zen 2020-07-21 20:42:15 +03:00
parent 226f4633b3
commit a63fc8786f
19 changed files with 10 additions and 24 deletions

View file

@ -2,7 +2,7 @@
import sys
from utils.utils import get_brightness, get_cq, man_q
from .utils import get_brightness, get_cq, man_q
from .logger import log

View file

@ -5,7 +5,7 @@ import os
import sys
from pathlib import Path
from utils.utils import terminate
from .utils import terminate
from .logger import log

View file

@ -1,8 +1,5 @@
#!/usr/bin/env python3
import json
from pathlib import Path
from .utils import terminate
from .compose import get_default_params_for_encoder
def conf(args):
"""Creation and reading of config files with saved settings"""

View file

@ -7,8 +7,7 @@ from ast import literal_eval
from pathlib import Path
from subprocess import PIPE, STDOUT
from utils.utils import frame_probe, get_keyframes
from .utils import frame_probe, get_keyframes
from .aom_kf import aom_keyframes
from .logger import log
from .pyscene import pyscene

View file

@ -1,12 +1,12 @@
#!/bin/env python
from utils.utils import terminate, frame_probe
from utils.vmaf import call_vmaf, read_vmaf_xml
from .utils import terminate, frame_probe
from .vmaf import call_vmaf, read_vmaf_xml
from scipy import interpolate
from pathlib import Path
import subprocess
import numpy as np
from utils.logger import log
from .logger import log
from matplotlib import pyplot as plt
import matplotlib
import sys
@ -103,7 +103,7 @@ def target_vmaf(source, args):
cmd = probe_cmd(probe, fork[i], args.ffmpeg_pipe, args.encoder)
subprocess.run(cmd, shell=True)
v = call_vmaf(probe, gen_probes_names(probe, fork[i]), n_threads=args.n_threads, model=args.vmaf_path, return_file=True)
v = call_vmaf(probe, gen_probes_names(probe, fork[i]), args.n_threads, args.vmaf_path, return_file=True)
mean = read_vmaf_xml(v, 25)
vmaf_cq.append((mean, fork[i]))

View file

@ -1,8 +1,6 @@
#!/bin/env python
import atexit
import json
import os
import re
import statistics
import subprocess

View file

@ -28,7 +28,7 @@ def read_vmaf_xml(file, percentile):
return perc
def call_vmaf(source: Path, encoded: Path, model, n_threads, return_file=False):
def call_vmaf(source: Path, encoded: Path, n_threads, model, return_file=False):
if model:
mod = f":model_path={model}"
@ -72,7 +72,7 @@ def plot_vmaf(inp: Path, out: Path, model=None):
print('Calculating Vmaf...\r', end='')
xml = call_vmaf(inp, out, n_threads=0, model=model, return_file=True)
xml = call_vmaf(inp, out, 0, model, return_file=True)
if not Path(xml).exists():
print(f'Vmaf calculation failed for files:\n {inp.stem} {out.stem}')

View file

@ -1,14 +1,6 @@
#!/usr/bin/env python3
import shutil
import subprocess
import sys
import time
from pathlib import Path
import json
from utils import *
from Av1an import *
class Av1an: