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
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 |
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 threading | |
class Thread(threading.Thread): | |
def __init__(self, group=None, target=None, name=None, args=(), kwargs=None, *, daemon=None): | |
threading.Thread.__init__(self, group, target, name, args, kwargs, daemon=daemon) | |
self._return = None | |
def run(self): | |
if self._target is not None: | |
self._return = self._target(*self._args, **self._kwargs) |
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
#!/usr/bin/env python | |
# Copyright (C) 2003-2007 Robey Pointer <[email protected]> | |
# | |
# This file is part of paramiko. | |
# | |
# Paramiko is free software; you can redistribute it and/or modify it under the | |
# terms of the GNU Lesser General Public License as published by the Free | |
# Software Foundation; either version 2.1 of the License, or (at your option) | |
# any later version. |