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
$directoryPath = "C:\Users" | |
$aesKey = [System.Text.Encoding]::UTF8.GetBytes("MySecretKey12345") | |
$aes = [System.Security.Cryptography.Aes]::Create() | |
$aes.Mode = [System.Security.Cryptography.CipherMode]::CBC | |
$aes.Padding = [System.Security.Cryptography.PaddingMode]::PKCS7 | |
$aes.Key = $aesKey | |
function Decrypt-File($filePath) { |
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
nfiles=10 | |
nbytes=$((2**20)) | |
for i in $(seq -f "%03g" 0 $(($nfiles - 1))); do | |
dd if=/dev/urandom bs=$nbytes count=1 > $i.bin | |
done |
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
function ClickConnect() { | |
document.querySelector("colab-toolbar-button").click() | |
} setInterval(ClickConnect, 600000) |
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
./ffmpeg -i input.mp4 -vcodec libx264 -crf 20 output.mp4 |
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
def get_lr(optimizer): | |
for p in optimizer.param_groups: | |
return p["lr"] |
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
def count_parameters(model): | |
return sum(p.numel() for p in model.parameters() if p.requires_grad) |
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 random | |
import numpy as np | |
import torch | |
def seed_everything(seed): | |
random.seed(seed) | |
os.environ["PYTHONHASHSEED"] = str(seed) | |
np.random.seed(seed) |
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
find . -mindepth 2 -type f -exec mv --backup=numbered {} . \; |
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 glob | |
import argparse | |
from tqdm import tqdm | |
import pandas as pd | |
def click_and_crop(event, x, y, flags, param, points): | |
if event == cv2.EVENT_LBUTTONUP: |
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 random | |
import cv2 | |
import numpy as np | |
import pandas as pd | |
import torch | |
import torch.cuda | |
import torch.nn as nn | |
from albumentations import * |
NewerOlder