https://www.linuxfordevices.com/tutorials/ubuntu/remove-an-apt-repository-ubuntu
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
#!/bin/bash | |
export ANDROID_SERIAL=`adb devices -l | grep -i oneplus | awk '{print $1}'` | |
droidcam-cli adb 4747& | |
scrcpy |
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
# https://stackoverflow.com/questions/59025321/capture-jpeg-images-from-rtsp-gstreamer | |
gst-launch-1.0 rtspsrc location="rtsp://admin:[email protected]/stream0" num-buffers=1 \ | |
! rtph264depay ! avdec_h264 \ | |
! nvjpegenc ! multifilesink location="./frame.jpg" |
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
version: '3' | |
services: | |
api: | |
image: imneonizer/autolycus:api | |
container_name: autolycus_api | |
ports: | |
- 5000:5000 | |
volumes: | |
- ./downloads:/downloads |
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 random | |
import colorsys | |
def generate_colors(n): | |
random.seed(10101) | |
hsv_tuples = [(x / n, 1., 1.) for x in range(n)] | |
colors = list(map(lambda x: colorsys.hsv_to_rgb(*x), hsv_tuples)) | |
colors = list(map(lambda x: (int(x[0] * 255), int(x[1] * 255), int(x[2] * 255)), colors)) | |
random.shuffle(colors) | |
random.seed(None) |
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
# https://github.com/yogin16/prototxt_parser | |
# pip install parsy==1.3.0 | |
from parsy import generate, regex, string | |
# Convert an array of tuples array [[(a,b),(a,c)]] to an object {a: [b,c]} | |
def tuples_to_dict(a): | |
# print(a) | |
new_dict = {} | |
for tuples in a: |
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
# https://github.com/linghu8812/blur_detector/blob/master/blur_detector.py | |
import cv2 | |
import numpy as np | |
class BlurDetector(object): | |
def __init__(self): | |
"""Initialize a DCT based blur detector""" |
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
# make sure terminal window is active when pressing any key | |
import cv2 | |
import numpy as np | |
import time | |
from waitKey import waitKey | |
frame = np.zeros((300, 300, 3)) | |
idx, st = 0, time.time() | |
while True: |
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 | |
import cv2 | |
import hashlib | |
import numpy as np | |
import scipy.fftpack | |
class HashEngine: | |
def __init__(self, htype="dhash", hash_size=8): | |
self.hash_size = hash_size | |
self.htype = htype |
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
# use multiple gpu devices by index | |
import os | |
#GPU_id = '0' | |
GPU_id = '0,1,2,3' | |
os.environ['CUDA_VISIBLE_DEVICES'] = GPU_id |