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 |
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 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
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
# Center Crop and Image Scaling functions in OpenCV | |
# Date: 11/10/2020 | |
# Written by Nandan M | |
import cv2 | |
def center_crop(img, dim): | |
"""Returns center cropped image | |
Args: |
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
// ==UserScript== | |
// @name Google digits | |
// @include https://www.google.tld/* | |
// @run-at document-start | |
// ==/UserScript== | |
// only work on search pages with #q= &q= ?q= | |
if (location.href.match(/[#&?]q=/)) { | |
window.addEventListener('keydown', function(e) { | |
var digit = e.keyCode - 48; |
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
// ==UserScript== | |
// @name Generic Key Listener | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description logs key events. useful for creating a script you want actived on a set of keys | |
// @author Petalousa | |
// @include * | |
// @grant none | |
// ==/UserScript== |
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
package jp.sumasu.test; | |
import android.app.Activity; | |
import android.content.Context; | |
import android.os.Bundle; | |
import android.telephony.PhoneStateListener; | |
import android.telephony.SignalStrength; | |
import android.telephony.TelephonyManager; | |
import android.widget.TextView; |
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 android.content.Context; | |
import android.net.ConnectivityManager; | |
import android.net.NetworkInfo; | |
import android.os.Build; | |
import android.telephony.PhoneStateListener; | |
import android.telephony.TelephonyManager; | |
import permissions.dispatcher.PermissionUtils; | |
/* |
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
package com.polysfactory.DrmFrameworkTest; | |
import java.lang.reflect.InvocationTargetException; | |
import java.lang.reflect.Method; | |
import android.app.Activity; | |
import android.drm.DrmManagerClient; | |
import android.os.Bundle; | |
import android.util.Log; | |
import android.widget.TextView; |
NewerOlder