This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os.path as osp | |
dataset_dir = '/home/frankllin/Downloads/DomainNet' | |
split_dir = osp.join(dataset_dir, 'splits_mini') | |
image_size = 84 | |
from PIL import Image | |
import h5py | |
import numpy as np | |
from tqdm import tqdm | |
def store_many_hdf5(h5file, images, labels): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import subprocess | |
import shlex | |
import json | |
# function to retrieve the timestamps of the input video file | |
def findVideoMetadata(pathToInputVideo): | |
cmd = "ffprobe -v quiet -print_format json -show_entries packet=pts_time" | |
args = shlex.split(cmd) | |
args.append(pathToInputVideo) | |
# run the ffprobe process, decode stdout into utf-8 & convert to JSON |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
Author: Asadullah Dal | |
Youtube Channel: https://www.youtube.com/c/aiphile | |
''' | |
import cv2 as cv | |
import numpy as np |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2 | |
import os | |
import numpy as np | |
class ExtractImageFromVideo(object): | |
def __init__(self, path, frame_range=None, debug=False): | |
assert os.path.exists(path) | |
self._p = path |
OlderNewer