コード例 #1
0
# yt helper
from yt_helper import get_urls, download_videos

# IO Parser
from io_utils import IOParser

if __name__ == '__main__':
    parser = IOParser()
    query = parser.input
    directory = parser.output

    urls = get_urls(query)
    download_videos(urls, directory)
コード例 #2
0
from io_utils import IOParser
from ia_helper import avg_image, DIR_OPTION
import os
extensions = ['.jpg', '.png', '.tif']
if __name__ == '__main__':
    parser = IOParser(add_args=[DIR_OPTION])
    directory = parser.input
    outfile = parser.output
    outdir = parser.directory
    paths = []
    for dirname, dirnames, filenames in os.walk(directory):
        for filename in filenames:
            if os.path.splitext(filename)[1] in extensions:
                paths.append(os.path.abspath(os.path.join(dirname, filename)))
    if outdir is None:
        avg_image(paths, outfile, frames_dir=outdir)
    else:
        avg_image(paths, outfile)
コード例 #3
0
# utils
from io_utils import IOParser
from ia_helper import download_files, FORMAT_OPTION, parse_formats

if __name__ == '__main__':
    parser = IOParser(add_args=[FORMAT_OPTION])
    query = parser.input
    outdir = parser.output
    formats = parser.formats
    paths = []
    if formats:
        paths = download_files(query, outdir, formats=parse_formats(formats))
    else:
        paths = download_files(query, outdir)
コード例 #4
0
from io_utils import IOParser
from audio import get_audio_files, avg_audio, DURATION

if __name__ == '__main__':
    parser = IOParser(add_args=[DURATION])
    input = parser.input
    output = parser.output
    duration = parser.duration

    wavs = get_audio_files(input)
    avg_audio(wavs, output, duration)