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
{ | |
"embeddings": [ | |
{ | |
"tensorName": "p_companion_embeddings", | |
"tensorShape": [ | |
8424, | |
360 | |
], | |
"tensorPath": "https://raw.githubusercontent.com/mythrex/p_companion_embedding/main/embeddings_l3_small.tsv", | |
"metadataPath": "https://raw.githubusercontent.com/mythrex/p_companion_embedding/main/embeddings_l3_meta_data.txt" |
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 run_bash(cmd_to_run:str, skip_flag:int=1, print_output:int=0): | |
if skip_flag == 1: | |
start = time() | |
print(cmd_to_run) | |
p = Popen(cmd_to_run, shell=True, stdout=PIPE) | |
p.wait() | |
if print_output == 1: | |
print(p.communicate()[0]) | |
print('Time taken: {} seconds.\n'.format(round(time() - start))) | |
else: |
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 requests | |
from bs4 import BeautifulSoup as bs | |
from tqdm.auto import tqdm | |
from joblib import Parallel, delayed | |
def get_title(url): | |
r = requests.get(url) | |
soup = bs(r.content, 'lxml') | |
return soup.title.string |
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
for i in **/*.mp4; do | |
sum=$(echo -n "$i" | md5sum) | |
mv -- "$i" "${sum%% *}.${i##*.}" | |
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
ffmpeg -ss 00:00:30 -i orginalfile -t 00:00:05 -vcodec copy -acodec copy newfile |
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
wget --no-check-certificate 'https://docs.google.com/uc?export=download&id=FILEID' -O FILENAME | |
wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id=FILEID' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=FILEID" -O "VOCtrainval_06-Nov-2007.tar" && rm -rf /tmp/cookies.txt |
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 argparse | |
from PIL import Image | |
import os | |
parser = argparse.ArgumentParser(description='Resize Image') | |
parser.add_argument('-path', | |
'--path', | |
help='Enter Image Path', | |
required=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
{ | |
"embeddings": [ | |
{ | |
"tensorName": "Deep Dream over text.", | |
"tensorShape": [ | |
78, | |
100 | |
], | |
"tensorPath": "https://raw.githubusercontent.com/mythrex/deep_dream_textual_data/master/embeddings/embeddings_neg.tsv", | |
"metadataPath": "https://raw.githubusercontent.com/mythrex/deep_dream_textual_data/master/embeddings/vocab_neg'.tsv" |
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 dream(input, model, iterations, lr): | |
""" Updates the image to maximize outputs for n iterations """ | |
model.eval() | |
out, orig_embeddings, hidden = model(input) | |
model.train() | |
losses = [] | |
embeddings_steps = [] | |
embeddings = torch.autograd.Variable( | |
orig_embeddings.mean(1), requires_grad=True) | |
embeddings_steps.append(embeddings.clone()) |
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
{ | |
"embeddings": [ | |
{ | |
"tensorName": "Deep Dream over text.", | |
"tensorShape": [ | |
78, | |
100 | |
], | |
"tensorPath": "https://raw.githubusercontent.com/mythrex/deep_dream_textual_data/master/embeddings/embeddings_pos.tsv", | |
"metadataPath": "https://raw.githubusercontent.com/mythrex/deep_dream_textual_data/master/embeddings/vocab_pos.tsv" |
NewerOlder