repo
stringlengths
7
90
file_url
stringlengths
81
315
file_path
stringlengths
4
228
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 14:38:15
2026-01-05 02:33:18
truncated
bool
2 classes
jim-schwoebel/allie
https://github.com/jim-schwoebel/allie/blob/b89f1403f63033ad406d0606b7c7a45000b43481/augmentation/text_augmentation/helpers/eda_nlp/experiments/d_2_tsne.py
augmentation/text_augmentation/helpers/eda_nlp/experiments/d_2_tsne.py
from methods import * from numpy.random import seed from keras import backend as K from sklearn.manifold import TSNE import matplotlib.pyplot as plt seed(0) ################################ #### get dense layer output #### ################################ #getting the x and y inputs in numpy array form from the text ...
python
Apache-2.0
b89f1403f63033ad406d0606b7c7a45000b43481
2026-01-05T07:09:07.495102Z
false
jim-schwoebel/allie
https://github.com/jim-schwoebel/allie/blob/b89f1403f63033ad406d0606b7c7a45000b43481/augmentation/text_augmentation/helpers/eda_nlp/experiments/c_2_train_eval.py
augmentation/text_augmentation/helpers/eda_nlp/experiments/c_2_train_eval.py
from c_config import * from methods import * from numpy.random import seed seed(5) ############################### #### run model and get acc #### ############################### def run_cnn(train_file, test_file, num_classes, percent_dataset): #initialize model model = build_cnn(input_size, word2vec_len, num_cla...
python
Apache-2.0
b89f1403f63033ad406d0606b7c7a45000b43481
2026-01-05T07:09:07.495102Z
false
jim-schwoebel/allie
https://github.com/jim-schwoebel/allie/blob/b89f1403f63033ad406d0606b7c7a45000b43481/augmentation/text_augmentation/helpers/eda_nlp/experiments/b_config.py
augmentation/text_augmentation/helpers/eda_nlp/experiments/b_config.py
#user inputs #dataset folder datasets = ['pc']#['cr', 'sst2', 'subj', 'trec', 'pc'] dataset_folders = ['increment_datasets_f2/' + dataset for dataset in datasets] #number of output classes num_classes_list = [2]#[2, 2, 2, 6, 2] #dataset increments increments = [0.7, 0.8, 0.9, 1]#[0.01, 0.05, 0.1, 0.2, 0.3, 0.4, 0.5...
python
Apache-2.0
b89f1403f63033ad406d0606b7c7a45000b43481
2026-01-05T07:09:07.495102Z
false
jim-schwoebel/allie
https://github.com/jim-schwoebel/allie/blob/b89f1403f63033ad406d0606b7c7a45000b43481/augmentation/text_augmentation/helpers/eda_nlp/experiments/a_config.py
augmentation/text_augmentation/helpers/eda_nlp/experiments/a_config.py
#user inputs #size folders sizes = ['1_tiny', '2_small', '3_standard', '4_full'] size_folders = ['size_data_f1/' + size for size in sizes] #augmentation methods a_methods = ['sr', 'ri', 'rd', 'rs'] #dataset folder datasets = ['cr', 'sst2', 'subj', 'trec', 'pc'] #number of output classes num_classes_list = [2, 2, 2,...
python
Apache-2.0
b89f1403f63033ad406d0606b7c7a45000b43481
2026-01-05T07:09:07.495102Z
false
jim-schwoebel/allie
https://github.com/jim-schwoebel/allie/blob/b89f1403f63033ad406d0606b7c7a45000b43481/augmentation/text_augmentation/helpers/eda_nlp/experiments/e_2_cnn_aug.py
augmentation/text_augmentation/helpers/eda_nlp/experiments/e_2_cnn_aug.py
from methods import * from numpy.random import seed seed(0) from e_config import * ############################### #### run model and get acc #### ############################### def run_cnn(train_file, test_file, num_classes, input_size, percent_dataset, word2vec): #initialize model model = build_cnn(input_size, ...
python
Apache-2.0
b89f1403f63033ad406d0606b7c7a45000b43481
2026-01-05T07:09:07.495102Z
false
jim-schwoebel/allie
https://github.com/jim-schwoebel/allie/blob/b89f1403f63033ad406d0606b7c7a45000b43481/augmentation/text_augmentation/helpers/eda_nlp/experiments/e_config.py
augmentation/text_augmentation/helpers/eda_nlp/experiments/e_config.py
#user inputs #load hyperparameters sizes = ['4_full']#['1_tiny', '2_small', '3_standard', '4_full'] size_folders = ['size_data_t1/' + size for size in sizes] #datasets datasets = ['cr', 'sst2', 'subj', 'trec', 'pc'] #number of output classes num_classes_list = [2, 2, 2, 6, 2] #number of augmentations per original s...
python
Apache-2.0
b89f1403f63033ad406d0606b7c7a45000b43481
2026-01-05T07:09:07.495102Z
false
jim-schwoebel/allie
https://github.com/jim-schwoebel/allie/blob/b89f1403f63033ad406d0606b7c7a45000b43481/augmentation/text_augmentation/helpers/eda_nlp/experiments/b_2_train_eval.py
augmentation/text_augmentation/helpers/eda_nlp/experiments/b_2_train_eval.py
from b_config import * from methods import * from numpy.random import seed seed(0) ############################### #### run model and get acc #### ############################### def run_model(train_file, test_file, num_classes, percent_dataset): #initialize model model = build_model(input_size, word2vec_len, num...
python
Apache-2.0
b89f1403f63033ad406d0606b7c7a45000b43481
2026-01-05T07:09:07.495102Z
false
jim-schwoebel/allie
https://github.com/jim-schwoebel/allie/blob/b89f1403f63033ad406d0606b7c7a45000b43481/augmentation/text_augmentation/helpers/eda_nlp/experiments/a_1_data_process.py
augmentation/text_augmentation/helpers/eda_nlp/experiments/a_1_data_process.py
from methods import * from a_config import * if __name__ == "__main__": #for each method for a_method in a_methods: #for each data size for size_folder in size_folders: n_aug_list = n_aug_list_dict[size_folder] dataset_folders = [size_folder + '/' + s for s in datasets] #for each dataset for i, d...
python
Apache-2.0
b89f1403f63033ad406d0606b7c7a45000b43481
2026-01-05T07:09:07.495102Z
false
jim-schwoebel/allie
https://github.com/jim-schwoebel/allie/blob/b89f1403f63033ad406d0606b7c7a45000b43481/augmentation/text_augmentation/helpers/eda_nlp/experiments/a_2_train_eval.py
augmentation/text_augmentation/helpers/eda_nlp/experiments/a_2_train_eval.py
from a_config import * from methods import * from numpy.random import seed seed(5) ############################### #### run model and get acc #### ############################### def run_cnn(train_file, test_file, num_classes, percent_dataset): #initialize model model = build_cnn(input_size, word2vec_len, num_cla...
python
Apache-2.0
b89f1403f63033ad406d0606b7c7a45000b43481
2026-01-05T07:09:07.495102Z
false
jim-schwoebel/allie
https://github.com/jim-schwoebel/allie/blob/b89f1403f63033ad406d0606b7c7a45000b43481/augmentation/text_augmentation/helpers/eda_nlp/experiments/d_0_preprocess.py
augmentation/text_augmentation/helpers/eda_nlp/experiments/d_0_preprocess.py
from methods import * def generate_short(input_file, output_file, alpha): lines = open(input_file, 'r').readlines() increment = int(len(lines)/alpha) lines = lines[::increment] writer = open(output_file, 'w') for line in lines: writer.write(line) if __name__ == "__main__": #global params huge_word2vec = 'wo...
python
Apache-2.0
b89f1403f63033ad406d0606b7c7a45000b43481
2026-01-05T07:09:07.495102Z
false
jim-schwoebel/allie
https://github.com/jim-schwoebel/allie/blob/b89f1403f63033ad406d0606b7c7a45000b43481/augmentation/text_augmentation/helpers/eda_nlp/experiments/e_1_data_process.py
augmentation/text_augmentation/helpers/eda_nlp/experiments/e_1_data_process.py
from methods import * from e_config import * if __name__ == "__main__": for size_folder in size_folders: dataset_folders = [size_folder + '/' + s for s in datasets] n_aug_list = n_aug_list_dict[size_folder] #for each dataset for i, dataset_folder in enumerate(dataset_folders): n_aug = n_aug_list[i] ...
python
Apache-2.0
b89f1403f63033ad406d0606b7c7a45000b43481
2026-01-05T07:09:07.495102Z
false
jim-schwoebel/allie
https://github.com/jim-schwoebel/allie/blob/b89f1403f63033ad406d0606b7c7a45000b43481/augmentation/text_augmentation/helpers/eda_nlp/experiments/e_2_rnn_aug.py
augmentation/text_augmentation/helpers/eda_nlp/experiments/e_2_rnn_aug.py
from methods import * from numpy.random import seed seed(0) from e_config import * ############################### #### run model and get acc #### ############################### def run_model(train_file, test_file, num_classes, input_size, percent_dataset, word2vec): #initialize model model = build_model(input_si...
python
Apache-2.0
b89f1403f63033ad406d0606b7c7a45000b43481
2026-01-05T07:09:07.495102Z
false
jim-schwoebel/allie
https://github.com/jim-schwoebel/allie/blob/b89f1403f63033ad406d0606b7c7a45000b43481/augmentation/text_augmentation/helpers/eda_nlp/experiments/d_neg_1_balance_trec.py
augmentation/text_augmentation/helpers/eda_nlp/experiments/d_neg_1_balance_trec.py
lines = open('special_f4/trec/test_orig.txt', 'r').readlines() label_to_lines = {x:[] for x in range(0, 6)} for line in lines: label = int(line[0]) label_to_lines[label].append(line) for label in label_to_lines: print(label, len(label_to_lines[label]))
python
Apache-2.0
b89f1403f63033ad406d0606b7c7a45000b43481
2026-01-05T07:09:07.495102Z
false
jim-schwoebel/allie
https://github.com/jim-schwoebel/allie/blob/b89f1403f63033ad406d0606b7c7a45000b43481/augmentation/text_augmentation/helpers/eda_nlp/experiments/e_2_cnn_baselines.py
augmentation/text_augmentation/helpers/eda_nlp/experiments/e_2_cnn_baselines.py
from methods import * from numpy.random import seed seed(0) from e_config import * ############################### #### run model and get acc #### ############################### def run_model(train_file, test_file, num_classes, input_size, percent_dataset, word2vec): #initialize model model = build_model(input_si...
python
Apache-2.0
b89f1403f63033ad406d0606b7c7a45000b43481
2026-01-05T07:09:07.495102Z
false
jim-schwoebel/allie
https://github.com/jim-schwoebel/allie/blob/b89f1403f63033ad406d0606b7c7a45000b43481/augmentation/text_augmentation/helpers/eda_nlp/experiments/methods.py
augmentation/text_augmentation/helpers/eda_nlp/experiments/methods.py
from keras.layers.core import Dense, Activation, Dropout from keras.layers.recurrent import LSTM from keras.layers import Bidirectional import keras.layers as layers from keras.models import Sequential from keras.models import load_model from keras.callbacks import EarlyStopping from sklearn.utils import shuffle from ...
python
Apache-2.0
b89f1403f63033ad406d0606b7c7a45000b43481
2026-01-05T07:09:07.495102Z
false
jim-schwoebel/allie
https://github.com/jim-schwoebel/allie/blob/b89f1403f63033ad406d0606b7c7a45000b43481/augmentation/text_augmentation/helpers/eda_nlp/experiments/c_config.py
augmentation/text_augmentation/helpers/eda_nlp/experiments/c_config.py
#user inputs #size folders sizes = ['3_standard']#, '4_full']#['1_tiny', '2_small', '3_standard', '4_full'] size_folders = ['size_data_f3/' + size for size in sizes] #dataset folder datasets = ['cr', 'sst2', 'subj', 'trec', 'pc'] #number of output classes num_classes_list = [2, 2, 2, 6, 2] #alpha values we care abo...
python
Apache-2.0
b89f1403f63033ad406d0606b7c7a45000b43481
2026-01-05T07:09:07.495102Z
false
jim-schwoebel/allie
https://github.com/jim-schwoebel/allie/blob/b89f1403f63033ad406d0606b7c7a45000b43481/augmentation/text_augmentation/helpers/eda_nlp/experiments/nlp_aug.py
augmentation/text_augmentation/helpers/eda_nlp/experiments/nlp_aug.py
# Easy data augmentation techniques for text classification # Jason Wei, Chengyu Huang, Yifang Wei, Fei Xing, Kai Zou import random from random import shuffle random.seed(1) #stop words list stop_words = ['i', 'me', 'my', 'myself', 'we', 'our', 'ours', 'ourselves', 'you', 'your', 'yours', 'yourself', 'yoursel...
python
Apache-2.0
b89f1403f63033ad406d0606b7c7a45000b43481
2026-01-05T07:09:07.495102Z
false
jim-schwoebel/allie
https://github.com/jim-schwoebel/allie/blob/b89f1403f63033ad406d0606b7c7a45000b43481/augmentation/text_augmentation/helpers/eda_nlp/experiments/e_2_rnn_baselines.py
augmentation/text_augmentation/helpers/eda_nlp/experiments/e_2_rnn_baselines.py
from methods import * from numpy.random import seed seed(0) from e_config import * ############################### #### run model and get acc #### ############################### def run_model(train_file, test_file, num_classes, input_size, percent_dataset, word2vec): #initialize model model = build_model(input_si...
python
Apache-2.0
b89f1403f63033ad406d0606b7c7a45000b43481
2026-01-05T07:09:07.495102Z
false
jim-schwoebel/allie
https://github.com/jim-schwoebel/allie/blob/b89f1403f63033ad406d0606b7c7a45000b43481/augmentation/text_augmentation/helpers/eda_nlp/experiments/c_1_data_process.py
augmentation/text_augmentation/helpers/eda_nlp/experiments/c_1_data_process.py
from methods import * from c_config import * if __name__ == "__main__": #generate the augmented data sets for size_folder in size_folders: dataset_folders = [size_folder + '/' + s for s in datasets] #for each dataset for dataset_folder in dataset_folders: train_orig = dataset_folder + '/train_orig.txt' ...
python
Apache-2.0
b89f1403f63033ad406d0606b7c7a45000b43481
2026-01-05T07:09:07.495102Z
false
jim-schwoebel/allie
https://github.com/jim-schwoebel/allie/blob/b89f1403f63033ad406d0606b7c7a45000b43481/augmentation/text_augmentation/helpers/eda_nlp/experiments/d_1_train_models.py
augmentation/text_augmentation/helpers/eda_nlp/experiments/d_1_train_models.py
from methods import * from numpy.random import seed seed(0) ############################### #### run model and get acc #### ############################### def run_model(train_file, test_file, num_classes, model_output_path): #initialize model model = build_model(input_size, word2vec_len, num_classes) #load data...
python
Apache-2.0
b89f1403f63033ad406d0606b7c7a45000b43481
2026-01-05T07:09:07.495102Z
false
jim-schwoebel/allie
https://github.com/jim-schwoebel/allie/blob/b89f1403f63033ad406d0606b7c7a45000b43481/augmentation/text_augmentation/helpers/eda_nlp/preprocess/bg_clean.py
augmentation/text_augmentation/helpers/eda_nlp/preprocess/bg_clean.py
from utils import * def clean_csv(input_file, output_file): input_r = open(input_file, 'r').read() lines = input_r.split(',,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,...
python
Apache-2.0
b89f1403f63033ad406d0606b7c7a45000b43481
2026-01-05T07:09:07.495102Z
false
jim-schwoebel/allie
https://github.com/jim-schwoebel/allie/blob/b89f1403f63033ad406d0606b7c7a45000b43481/augmentation/text_augmentation/helpers/eda_nlp/preprocess/subj_clean.py
augmentation/text_augmentation/helpers/eda_nlp/preprocess/subj_clean.py
from utils import * if __name__ == "__main__": subj_path = "subj/rotten_imdb/subj.txt" obj_path = "subj/rotten_imdb/plot.tok.gt9.5000" subj_lines = open(subj_path, 'r').readlines() obj_lines = open(obj_path, 'r').readlines() print(len(subj_lines), len(obj_lines)) test_split = int(0.9*len(subj_lines)) train_...
python
Apache-2.0
b89f1403f63033ad406d0606b7c7a45000b43481
2026-01-05T07:09:07.495102Z
false
jim-schwoebel/allie
https://github.com/jim-schwoebel/allie/blob/b89f1403f63033ad406d0606b7c7a45000b43481/augmentation/text_augmentation/helpers/eda_nlp/preprocess/sst1_clean.py
augmentation/text_augmentation/helpers/eda_nlp/preprocess/sst1_clean.py
from utils import * def get_label(decimal): if decimal >= 0 and decimal <= 0.2: return 0 elif decimal > 0.2 and decimal <= 0.4: return 1 elif decimal > 0.4 and decimal <= 0.6: return 2 elif decimal > 0.6 and decimal <= 0.8: return 3 elif decimal > 0.8 and decimal <= 1: return 4 else: return -1 def g...
python
Apache-2.0
b89f1403f63033ad406d0606b7c7a45000b43481
2026-01-05T07:09:07.495102Z
false
jim-schwoebel/allie
https://github.com/jim-schwoebel/allie/blob/b89f1403f63033ad406d0606b7c7a45000b43481/augmentation/text_augmentation/helpers/eda_nlp/preprocess/shuffle_lines.py
augmentation/text_augmentation/helpers/eda_nlp/preprocess/shuffle_lines.py
import random def shuffle_lines(text_file): lines = open(text_file).readlines() random.shuffle(lines) open(text_file, 'w').writelines(lines) shuffle_lines('special_f4/pc/test_short_aug_shuffle.txt')
python
Apache-2.0
b89f1403f63033ad406d0606b7c7a45000b43481
2026-01-05T07:09:07.495102Z
false
jim-schwoebel/allie
https://github.com/jim-schwoebel/allie/blob/b89f1403f63033ad406d0606b7c7a45000b43481/augmentation/text_augmentation/helpers/eda_nlp/preprocess/procon_clean.py
augmentation/text_augmentation/helpers/eda_nlp/preprocess/procon_clean.py
from utils import * def get_good_stuff(line): idx = line.find('s>') good = line[idx+2:-8] return get_only_chars(good) def clean_file(con_file, pro_file, output_train, output_test): train_writer = open(output_train, 'w') test_writer = open(output_test, 'w') con_lines = open(con_file, 'r').readlines() for lin...
python
Apache-2.0
b89f1403f63033ad406d0606b7c7a45000b43481
2026-01-05T07:09:07.495102Z
false
jim-schwoebel/allie
https://github.com/jim-schwoebel/allie/blob/b89f1403f63033ad406d0606b7c7a45000b43481/augmentation/text_augmentation/helpers/eda_nlp/preprocess/trej_clean.py
augmentation/text_augmentation/helpers/eda_nlp/preprocess/trej_clean.py
from utils import * class_name_to_num = {'DESC': 0, 'ENTY':1, 'ABBR':2, 'HUM': 3, 'LOC': 4, 'NUM': 5} def clean(input_file, output_file): lines = open(input_file, 'r').readlines() writer = open(output_file, 'w') for line in lines: parts = line[:-1].split(' ') tag = parts[0].split(':')[0] class_num = class_n...
python
Apache-2.0
b89f1403f63033ad406d0606b7c7a45000b43481
2026-01-05T07:09:07.495102Z
false
jim-schwoebel/allie
https://github.com/jim-schwoebel/allie/blob/b89f1403f63033ad406d0606b7c7a45000b43481/augmentation/text_augmentation/helpers/eda_nlp/preprocess/utils.py
augmentation/text_augmentation/helpers/eda_nlp/preprocess/utils.py
import re #cleaning up text def get_only_chars(line): clean_line = "" line = line.lower() line = line.replace(" 's", " is") line = line.replace("-", " ") #replace hyphens with spaces line = line.replace("\t", " ") line = line.replace("\n", " ") line = line.replace("'", "") for ch...
python
Apache-2.0
b89f1403f63033ad406d0606b7c7a45000b43481
2026-01-05T07:09:07.495102Z
false
jim-schwoebel/allie
https://github.com/jim-schwoebel/allie/blob/b89f1403f63033ad406d0606b7c7a45000b43481/augmentation/text_augmentation/helpers/eda_nlp/preprocess/create_dataset_increments.py
augmentation/text_augmentation/helpers/eda_nlp/preprocess/create_dataset_increments.py
import os datasets = ['cr', 'pc', 'sst1', 'sst2', 'subj', 'trec'] for dataset in datasets: line = 'cat increment_datasets_f2/' + dataset + '/test.txt > sized_datasets_f1/test/' + dataset + '/test.txt' os.system(line)
python
Apache-2.0
b89f1403f63033ad406d0606b7c7a45000b43481
2026-01-05T07:09:07.495102Z
false
jim-schwoebel/allie
https://github.com/jim-schwoebel/allie/blob/b89f1403f63033ad406d0606b7c7a45000b43481/augmentation/text_augmentation/helpers/eda_nlp/preprocess/cr_clean.py
augmentation/text_augmentation/helpers/eda_nlp/preprocess/cr_clean.py
#0 = neg, 1 = pos from utils import * def retrieve_reviews(line): reviews = set() chars = list(line) for i, char in enumerate(chars): if char == '[': if chars[i+1] == '-': reviews.add(0) elif chars[i+1] == '+': reviews.add(1) reviews = list(reviews) if len(reviews) == 2: return -2 elif len(r...
python
Apache-2.0
b89f1403f63033ad406d0606b7c7a45000b43481
2026-01-05T07:09:07.495102Z
false
jim-schwoebel/allie
https://github.com/jim-schwoebel/allie/blob/b89f1403f63033ad406d0606b7c7a45000b43481/augmentation/text_augmentation/helpers/eda_nlp/preprocess/copy_sized_datasets.py
augmentation/text_augmentation/helpers/eda_nlp/preprocess/copy_sized_datasets.py
import os sizes = ['1_tiny', '2_small', '3_standard', '4_full'] datasets = ['sst2', 'cr', 'subj', 'trec', 'pc'] for size in sizes: for dataset in datasets: folder = 'size_data_t1/' + size + '/' + dataset if not os.path.exists(folder): os.makedirs(folder) origin = 'sized_datasets_f1/' + size + '/' + dataset...
python
Apache-2.0
b89f1403f63033ad406d0606b7c7a45000b43481
2026-01-05T07:09:07.495102Z
false
jim-schwoebel/allie
https://github.com/jim-schwoebel/allie/blob/b89f1403f63033ad406d0606b7c7a45000b43481/augmentation/text_augmentation/helpers/eda_nlp/preprocess/get_stats.py
augmentation/text_augmentation/helpers/eda_nlp/preprocess/get_stats.py
import statistics datasets = ['sst2', 'cr', 'subj', 'trec', 'pc'] filenames = ['increment_datasets_f2/' + x + '/train_orig.txt' for x in datasets] def get_vocab_size(filename): lines = open(filename, 'r').readlines() vocab = set() for line in lines: words = line[:-1].split(' ') for word in words: if word ...
python
Apache-2.0
b89f1403f63033ad406d0606b7c7a45000b43481
2026-01-05T07:09:07.495102Z
false
jim-schwoebel/allie
https://github.com/jim-schwoebel/allie/blob/b89f1403f63033ad406d0606b7c7a45000b43481/augmentation/text_augmentation/helpers/eda_nlp/code/eda.py
augmentation/text_augmentation/helpers/eda_nlp/code/eda.py
# Easy data augmentation techniques for text classification # Jason Wei and Kai Zou import random from random import shuffle random.seed(1) #stop words list stop_words = ['i', 'me', 'my', 'myself', 'we', 'our', 'ours', 'ourselves', 'you', 'your', 'yours', 'yourself', 'yourselves', 'he', 'him', 'his', 'him...
python
Apache-2.0
b89f1403f63033ad406d0606b7c7a45000b43481
2026-01-05T07:09:07.495102Z
false
jim-schwoebel/allie
https://github.com/jim-schwoebel/allie/blob/b89f1403f63033ad406d0606b7c7a45000b43481/augmentation/text_augmentation/helpers/eda_nlp/code/augment.py
augmentation/text_augmentation/helpers/eda_nlp/code/augment.py
# Easy data augmentation techniques for text classification # Jason Wei and Kai Zou from eda import * #arguments to be parsed from command line import argparse ap = argparse.ArgumentParser() ap.add_argument("--input", required=True, type=str, help="input file of unaugmented data") ap.add_argument("--output", required...
python
Apache-2.0
b89f1403f63033ad406d0606b7c7a45000b43481
2026-01-05T07:09:07.495102Z
false
jim-schwoebel/allie
https://github.com/jim-schwoebel/allie/blob/b89f1403f63033ad406d0606b7c7a45000b43481/augmentation/audio_augmentation/augment_time.py
augmentation/audio_augmentation/augment_time.py
''' AAA lllllll lllllll iiii A:::A l:::::l l:::::l i::::i A:::::A l:::::l l:::::l iiii A:::::::A l:::::l l:::::l ...
python
Apache-2.0
b89f1403f63033ad406d0606b7c7a45000b43481
2026-01-05T07:09:07.495102Z
false
jim-schwoebel/allie
https://github.com/jim-schwoebel/allie/blob/b89f1403f63033ad406d0606b7c7a45000b43481/augmentation/audio_augmentation/augment_volume.py
augmentation/audio_augmentation/augment_volume.py
''' AAA lllllll lllllll iiii A:::A l:::::l l:::::l i::::i A:::::A l:::::l l:::::l iiii A:::::::A l:::::l l:::::l ...
python
Apache-2.0
b89f1403f63033ad406d0606b7c7a45000b43481
2026-01-05T07:09:07.495102Z
false
jim-schwoebel/allie
https://github.com/jim-schwoebel/allie/blob/b89f1403f63033ad406d0606b7c7a45000b43481/augmentation/audio_augmentation/augment_randomsplice.py
augmentation/audio_augmentation/augment_randomsplice.py
''' AAA lllllll lllllll iiii A:::A l:::::l l:::::l i::::i A:::::A l:::::l l:::::l iiii A:::::::A l:::::l l:::::l ...
python
Apache-2.0
b89f1403f63033ad406d0606b7c7a45000b43481
2026-01-05T07:09:07.495102Z
false
jim-schwoebel/allie
https://github.com/jim-schwoebel/allie/blob/b89f1403f63033ad406d0606b7c7a45000b43481/augmentation/audio_augmentation/augment_silence.py
augmentation/audio_augmentation/augment_silence.py
''' AAA lllllll lllllll iiii A:::A l:::::l l:::::l i::::i A:::::A l:::::l l:::::l iiii A:::::::A l:::::l l:::::l ...
python
Apache-2.0
b89f1403f63033ad406d0606b7c7a45000b43481
2026-01-05T07:09:07.495102Z
false
jim-schwoebel/allie
https://github.com/jim-schwoebel/allie/blob/b89f1403f63033ad406d0606b7c7a45000b43481/augmentation/audio_augmentation/augment_tsaug.py
augmentation/audio_augmentation/augment_tsaug.py
''' AAA lllllll lllllll iiii A:::A l:::::l l:::::l i::::i A:::::A l:::::l l:::::l iiii A:::::::A l:::::l l:::::l ...
python
Apache-2.0
b89f1403f63033ad406d0606b7c7a45000b43481
2026-01-05T07:09:07.495102Z
false
jim-schwoebel/allie
https://github.com/jim-schwoebel/allie/blob/b89f1403f63033ad406d0606b7c7a45000b43481/augmentation/audio_augmentation/augment_noise.py
augmentation/audio_augmentation/augment_noise.py
''' AAA lllllll lllllll iiii A:::A l:::::l l:::::l i::::i A:::::A l:::::l l:::::l iiii A:::::::A l:::::l l:::::l ...
python
Apache-2.0
b89f1403f63033ad406d0606b7c7a45000b43481
2026-01-05T07:09:07.495102Z
false
jim-schwoebel/allie
https://github.com/jim-schwoebel/allie/blob/b89f1403f63033ad406d0606b7c7a45000b43481/augmentation/audio_augmentation/augment.py
augmentation/audio_augmentation/augment.py
''' AAA lllllll lllllll iiii A:::A l:::::l l:::::l i::::i A:::::A l:::::l l:::::l iiii A:::::::A l:::::l l:::::l ...
python
Apache-2.0
b89f1403f63033ad406d0606b7c7a45000b43481
2026-01-05T07:09:07.495102Z
false
jim-schwoebel/allie
https://github.com/jim-schwoebel/allie/blob/b89f1403f63033ad406d0606b7c7a45000b43481/augmentation/audio_augmentation/augment_addnoise.py
augmentation/audio_augmentation/augment_addnoise.py
''' AAA lllllll lllllll iiii A:::A l:::::l l:::::l i::::i A:::::A l:::::l l:::::l iiii A:::::::A l:::::l l:::::l ...
python
Apache-2.0
b89f1403f63033ad406d0606b7c7a45000b43481
2026-01-05T07:09:07.495102Z
false
jim-schwoebel/allie
https://github.com/jim-schwoebel/allie/blob/b89f1403f63033ad406d0606b7c7a45000b43481/augmentation/audio_augmentation/augment_pitch.py
augmentation/audio_augmentation/augment_pitch.py
''' AAA lllllll lllllll iiii A:::A l:::::l l:::::l i::::i A:::::A l:::::l l:::::l iiii A:::::::A l:::::l l:::::l ...
python
Apache-2.0
b89f1403f63033ad406d0606b7c7a45000b43481
2026-01-05T07:09:07.495102Z
false
jim-schwoebel/allie
https://github.com/jim-schwoebel/allie/blob/b89f1403f63033ad406d0606b7c7a45000b43481/augmentation/audio_augmentation/helpers/audio_augment.py
augmentation/audio_augmentation/helpers/audio_augment.py
import os, sys, librosa, shutil, time, random, math from pydub import AudioSegment import soundfile as sf def remove_json(): listdir=os.listdir() for i in range(len(listdir)): if listdir[i][-5:]=='.json': os.remove(listdir[i]) def convert_audio(): listdir=os.listdir() for i in range(len(listdir)): if ...
python
Apache-2.0
b89f1403f63033ad406d0606b7c7a45000b43481
2026-01-05T07:09:07.495102Z
false
jim-schwoebel/allie
https://github.com/jim-schwoebel/allie/blob/b89f1403f63033ad406d0606b7c7a45000b43481/augmentation/audio_augmentation/helpers/audio_augmentation/setup.py
augmentation/audio_augmentation/helpers/audio_augmentation/setup.py
''' Quick installation script to get everything up-and-running. ''' import os os.system('brew install opus-tools') os.system('brew install opus') os.system('brew install sox') os.system('brew install ffmpeg') os.system('pip3 install -U nltk') import nltk nltk.download('wordnet') os.system('pip3 install -r requirements...
python
Apache-2.0
b89f1403f63033ad406d0606b7c7a45000b43481
2026-01-05T07:09:07.495102Z
false
jim-schwoebel/allie
https://github.com/jim-schwoebel/allie/blob/b89f1403f63033ad406d0606b7c7a45000b43481/augmentation/audio_augmentation/helpers/audio_augmentation/audio_augment_folder.py
augmentation/audio_augmentation/helpers/audio_augmentation/audio_augment_folder.py
import os, sys, librosa, shutil, time, random, math from pydub import AudioSegment import soundfile as sf def remove_json(): listdir=os.listdir() for i in range(len(listdir)): if listdir[i][-5:]=='.json': os.remove(listdir[i]) def convert_audio(): listdir=os.listdir() for i in range(len(listdir)): if ...
python
Apache-2.0
b89f1403f63033ad406d0606b7c7a45000b43481
2026-01-05T07:09:07.495102Z
false
jim-schwoebel/allie
https://github.com/jim-schwoebel/allie/blob/b89f1403f63033ad406d0606b7c7a45000b43481/augmentation/image_augmentation/augment_imgaug.py
augmentation/image_augmentation/augment_imgaug.py
''' AAA lllllll lllllll iiii A:::A l:::::l l:::::l i::::i A:::::A l:::::l l:::::l iiii A:::::::A l:::::l l:::::l ...
python
Apache-2.0
b89f1403f63033ad406d0606b7c7a45000b43481
2026-01-05T07:09:07.495102Z
false
jim-schwoebel/allie
https://github.com/jim-schwoebel/allie/blob/b89f1403f63033ad406d0606b7c7a45000b43481/augmentation/image_augmentation/augment.py
augmentation/image_augmentation/augment.py
''' AAA lllllll lllllll iiii A:::A l:::::l l:::::l i::::i A:::::A l:::::l l:::::l iiii A:::::::A l:::::l l:::::l ...
python
Apache-2.0
b89f1403f63033ad406d0606b7c7a45000b43481
2026-01-05T07:09:07.495102Z
false
jim-schwoebel/allie
https://github.com/jim-schwoebel/allie/blob/b89f1403f63033ad406d0606b7c7a45000b43481/augmentation/image_augmentation/helpers/imgaug/multicore.py
augmentation/image_augmentation/helpers/imgaug/multicore.py
"""Classes and functions dealing with multicore augmentation.""" from __future__ import print_function, division, absolute_import import sys import multiprocessing import threading import traceback import time import random import numpy as np import imgaug.imgaug as ia from imgaug.augmentables.batches import Batch, U...
python
Apache-2.0
b89f1403f63033ad406d0606b7c7a45000b43481
2026-01-05T07:09:07.495102Z
false
jim-schwoebel/allie
https://github.com/jim-schwoebel/allie/blob/b89f1403f63033ad406d0606b7c7a45000b43481/augmentation/image_augmentation/helpers/imgaug/testutils.py
augmentation/image_augmentation/helpers/imgaug/testutils.py
""" Some utility functions that are only used for unittests. Placing them in test/ directory seems to be against convention, so they are part of the library. """ from __future__ import print_function, division, absolute_import import random import numpy as np import six.moves as sm import imgaug as ia def create_...
python
Apache-2.0
b89f1403f63033ad406d0606b7c7a45000b43481
2026-01-05T07:09:07.495102Z
false
jim-schwoebel/allie
https://github.com/jim-schwoebel/allie/blob/b89f1403f63033ad406d0606b7c7a45000b43481/augmentation/image_augmentation/helpers/imgaug/__init__.py
augmentation/image_augmentation/helpers/imgaug/__init__.py
from __future__ import absolute_import # this contains some deprecated classes/functions pointing to the new # classes/functions, hence always place the other imports below this so that # the deprecated stuff gets overwritten as much as possible from imgaug.imgaug import * import imgaug.augmentables as augmentables f...
python
Apache-2.0
b89f1403f63033ad406d0606b7c7a45000b43481
2026-01-05T07:09:07.495102Z
false
jim-schwoebel/allie
https://github.com/jim-schwoebel/allie/blob/b89f1403f63033ad406d0606b7c7a45000b43481/augmentation/image_augmentation/helpers/imgaug/dtypes.py
augmentation/image_augmentation/helpers/imgaug/dtypes.py
from __future__ import print_function, division import warnings import numpy as np import six.moves as sm import imgaug as ia KIND_TO_DTYPES = { "i": ["int8", "int16", "int32", "int64"], "u": ["uint8", "uint16", "uint32", "uint64"], "b": ["bool"], "f": ["float16", "float32", "float64", "float128"] } ...
python
Apache-2.0
b89f1403f63033ad406d0606b7c7a45000b43481
2026-01-05T07:09:07.495102Z
false
jim-schwoebel/allie
https://github.com/jim-schwoebel/allie/blob/b89f1403f63033ad406d0606b7c7a45000b43481/augmentation/image_augmentation/helpers/imgaug/parameters.py
augmentation/image_augmentation/helpers/imgaug/parameters.py
from __future__ import print_function, division, absolute_import import copy as copy_module from collections import defaultdict from abc import ABCMeta, abstractmethod import tempfile import numpy as np import six import six.moves as sm import scipy import scipy.stats import imageio from . import imgaug as ia from . ...
python
Apache-2.0
b89f1403f63033ad406d0606b7c7a45000b43481
2026-01-05T07:09:07.495102Z
true
jim-schwoebel/allie
https://github.com/jim-schwoebel/allie/blob/b89f1403f63033ad406d0606b7c7a45000b43481/augmentation/image_augmentation/helpers/imgaug/imgaug.py
augmentation/image_augmentation/helpers/imgaug/imgaug.py
from __future__ import print_function, division, absolute_import import math import numbers import sys import os import json import types import functools import numpy as np import cv2 import imageio import six import six.moves as sm import skimage.draw import skimage.measure import collections from PIL import Image ...
python
Apache-2.0
b89f1403f63033ad406d0606b7c7a45000b43481
2026-01-05T07:09:07.495102Z
true
jim-schwoebel/allie
https://github.com/jim-schwoebel/allie/blob/b89f1403f63033ad406d0606b7c7a45000b43481/augmentation/image_augmentation/helpers/imgaug/augmenters/weather.py
augmentation/image_augmentation/helpers/imgaug/augmenters/weather.py
""" Augmenters that create wheather effects. Do not import directly from this file, as the categorization is not final. Use instead:: from imgaug import augmenters as iaa and then e.g.:: seq = iaa.Sequential([iaa.Snowflakes()]) List of augmenters: * FastSnowyLandscape * Clouds * Fog * Clou...
python
Apache-2.0
b89f1403f63033ad406d0606b7c7a45000b43481
2026-01-05T07:09:07.495102Z
true
jim-schwoebel/allie
https://github.com/jim-schwoebel/allie/blob/b89f1403f63033ad406d0606b7c7a45000b43481/augmentation/image_augmentation/helpers/imgaug/augmenters/edges.py
augmentation/image_augmentation/helpers/imgaug/augmenters/edges.py
""" Augmenters that deal with edge detection. Do not import directly from this file, as the categorization is not final. Use instead :: from imgaug import augmenters as iaa and then e.g. :: seq = iaa.Sequential([ iaa.Canny() ]) List of augmenters: * Canny EdgeDetect and DirectedEdgeDetect...
python
Apache-2.0
b89f1403f63033ad406d0606b7c7a45000b43481
2026-01-05T07:09:07.495102Z
false
jim-schwoebel/allie
https://github.com/jim-schwoebel/allie/blob/b89f1403f63033ad406d0606b7c7a45000b43481/augmentation/image_augmentation/helpers/imgaug/augmenters/blend.py
augmentation/image_augmentation/helpers/imgaug/augmenters/blend.py
""" Augmenters that blend two images with each other. Do not import directly from this file, as the categorization is not final. Use instead :: from imgaug import augmenters as iaa and then e.g. :: seq = iaa.Sequential([ iaa.Alpha(0.5, iaa.Add((-5, 5))) ]) List of augmenters: * Alpha *...
python
Apache-2.0
b89f1403f63033ad406d0606b7c7a45000b43481
2026-01-05T07:09:07.495102Z
true
jim-schwoebel/allie
https://github.com/jim-schwoebel/allie/blob/b89f1403f63033ad406d0606b7c7a45000b43481/augmentation/image_augmentation/helpers/imgaug/augmenters/contrast.py
augmentation/image_augmentation/helpers/imgaug/augmenters/contrast.py
""" Augmenters that perform contrast changes. Do not import directly from this file, as the categorization is not final. Use instead :: from imgaug import augmenters as iaa and then e.g. :: seq = iaa.Sequential([iaa.GammaContrast((0.5, 1.5))]) List of augmenters: * GammaContrast * SigmoidContrast ...
python
Apache-2.0
b89f1403f63033ad406d0606b7c7a45000b43481
2026-01-05T07:09:07.495102Z
true
jim-schwoebel/allie
https://github.com/jim-schwoebel/allie/blob/b89f1403f63033ad406d0606b7c7a45000b43481/augmentation/image_augmentation/helpers/imgaug/augmenters/arithmetic.py
augmentation/image_augmentation/helpers/imgaug/augmenters/arithmetic.py
""" Augmenters that perform simple arithmetic changes. Do not import directly from this file, as the categorization is not final. Use instead:: from imgaug import augmenters as iaa and then e.g.:: seq = iaa.Sequential([iaa.Add((-5, 5)), iaa.Multiply((0.9, 1.1))]) List of augmenters: * Add * AddEle...
python
Apache-2.0
b89f1403f63033ad406d0606b7c7a45000b43481
2026-01-05T07:09:07.495102Z
true
jim-schwoebel/allie
https://github.com/jim-schwoebel/allie/blob/b89f1403f63033ad406d0606b7c7a45000b43481/augmentation/image_augmentation/helpers/imgaug/augmenters/flip.py
augmentation/image_augmentation/helpers/imgaug/augmenters/flip.py
""" Augmenters that apply mirroring/flipping operations to images. Do not import directly from this file, as the categorization is not final. Use instead :: from imgaug import augmenters as iaa and then e.g. :: seq = iaa.Sequential([ iaa.Fliplr((0.0, 1.0)), iaa.Flipud((0.0, 1.0)) ]) Lis...
python
Apache-2.0
b89f1403f63033ad406d0606b7c7a45000b43481
2026-01-05T07:09:07.495102Z
false
jim-schwoebel/allie
https://github.com/jim-schwoebel/allie/blob/b89f1403f63033ad406d0606b7c7a45000b43481/augmentation/image_augmentation/helpers/imgaug/augmenters/size.py
augmentation/image_augmentation/helpers/imgaug/augmenters/size.py
""" Augmenters that somehow change the size of the images. Do not import directly from this file, as the categorization is not final. Use instead :: from imgaug import augmenters as iaa and then e.g. :: seq = iaa.Sequential([ iaa.Resize({"height": 32, "width": 64}) iaa.Crop((0, 20)) ]) ...
python
Apache-2.0
b89f1403f63033ad406d0606b7c7a45000b43481
2026-01-05T07:09:07.495102Z
true
jim-schwoebel/allie
https://github.com/jim-schwoebel/allie/blob/b89f1403f63033ad406d0606b7c7a45000b43481/augmentation/image_augmentation/helpers/imgaug/augmenters/meta.py
augmentation/image_augmentation/helpers/imgaug/augmenters/meta.py
""" Augmenters that don't apply augmentations themselves, but are needed for meta usage. Do not import directly from this file, as the categorization is not final. Use instead :: from imgaug import augmenters as iaa and then e.g. :: seq = iaa.Sequential([...]) List of augmenters: * Augmenter (base cla...
python
Apache-2.0
b89f1403f63033ad406d0606b7c7a45000b43481
2026-01-05T07:09:07.495102Z
true
jim-schwoebel/allie
https://github.com/jim-schwoebel/allie/blob/b89f1403f63033ad406d0606b7c7a45000b43481/augmentation/image_augmentation/helpers/imgaug/augmenters/pooling.py
augmentation/image_augmentation/helpers/imgaug/augmenters/pooling.py
""" Augmenters that apply pooling operations to images. Do not import directly from this file, as the categorization is not final. Use instead :: from imgaug import augmenters as iaa and then e.g. :: seq = iaa.Sequential([ iaa.AveragePooling((1, 3)) ]) List of augmenters: * AveragePooling ...
python
Apache-2.0
b89f1403f63033ad406d0606b7c7a45000b43481
2026-01-05T07:09:07.495102Z
false
jim-schwoebel/allie
https://github.com/jim-schwoebel/allie/blob/b89f1403f63033ad406d0606b7c7a45000b43481/augmentation/image_augmentation/helpers/imgaug/augmenters/convolutional.py
augmentation/image_augmentation/helpers/imgaug/augmenters/convolutional.py
""" Augmenters that apply convolutions to images. Do not import directly from this file, as the categorization is not final. Use instead :: from imgaug import augmenters as iaa and then e.g. :: seq = iaa.Sequential([ iaa.Sharpen((0.0, 1.0)), iaa.Emboss((0.0, 1.0)) ]) List of augmenters:...
python
Apache-2.0
b89f1403f63033ad406d0606b7c7a45000b43481
2026-01-05T07:09:07.495102Z
false
jim-schwoebel/allie
https://github.com/jim-schwoebel/allie/blob/b89f1403f63033ad406d0606b7c7a45000b43481/augmentation/image_augmentation/helpers/imgaug/augmenters/geometric.py
augmentation/image_augmentation/helpers/imgaug/augmenters/geometric.py
""" Augmenters that apply affine transformations or other similar augmentations. Do not import directly from this file, as the categorization is not final. Use instead :: from imgaug import augmenters as iaa and then e.g. :: seq = iaa.Sequential([ iaa.Affine(...), iaa.PerspectiveTransform(.....
python
Apache-2.0
b89f1403f63033ad406d0606b7c7a45000b43481
2026-01-05T07:09:07.495102Z
true
jim-schwoebel/allie
https://github.com/jim-schwoebel/allie/blob/b89f1403f63033ad406d0606b7c7a45000b43481/augmentation/image_augmentation/helpers/imgaug/augmenters/__init__.py
augmentation/image_augmentation/helpers/imgaug/augmenters/__init__.py
from __future__ import absolute_import from imgaug.augmenters.arithmetic import * from imgaug.augmenters.blend import * from imgaug.augmenters.blur import * from imgaug.augmenters.color import * from imgaug.augmenters.contrast import * from imgaug.augmenters.convolutional import * from imgaug.augmenters.edges import * ...
python
Apache-2.0
b89f1403f63033ad406d0606b7c7a45000b43481
2026-01-05T07:09:07.495102Z
false
jim-schwoebel/allie
https://github.com/jim-schwoebel/allie/blob/b89f1403f63033ad406d0606b7c7a45000b43481/augmentation/image_augmentation/helpers/imgaug/augmenters/color.py
augmentation/image_augmentation/helpers/imgaug/augmenters/color.py
""" Augmenters that apply color space oriented changes. Do not import directly from this file, as the categorization is not final. Use instead :: from imgaug import augmenters as iaa and then e.g. :: seq = iaa.Sequential([ iaa.Grayscale((0.0, 1.0)), iaa.AddToHueAndSaturation((-10, 10)) ]...
python
Apache-2.0
b89f1403f63033ad406d0606b7c7a45000b43481
2026-01-05T07:09:07.495102Z
false
jim-schwoebel/allie
https://github.com/jim-schwoebel/allie/blob/b89f1403f63033ad406d0606b7c7a45000b43481/augmentation/image_augmentation/helpers/imgaug/augmenters/segmentation.py
augmentation/image_augmentation/helpers/imgaug/augmenters/segmentation.py
""" Augmenters that apply changes to images based on forms of segmentation. Do not import directly from this file, as the categorization is not final. Use instead :: from imgaug import augmenters as iaa and then e.g. :: seq = iaa.Sequential([ iaa.Superpixels(...) ]) List of augmenters: * S...
python
Apache-2.0
b89f1403f63033ad406d0606b7c7a45000b43481
2026-01-05T07:09:07.495102Z
false
jim-schwoebel/allie
https://github.com/jim-schwoebel/allie/blob/b89f1403f63033ad406d0606b7c7a45000b43481/augmentation/image_augmentation/helpers/imgaug/augmenters/blur.py
augmentation/image_augmentation/helpers/imgaug/augmenters/blur.py
""" Augmenters that blur images. Do not import directly from this file, as the categorization is not final. Use instead :: from imgaug import augmenters as iaa and then e.g. :: seq = iaa.Sequential([ iaa.GaussianBlur((0.0, 3.0)), iaa.AverageBlur((2, 5)) ]) List of augmenters: * Gau...
python
Apache-2.0
b89f1403f63033ad406d0606b7c7a45000b43481
2026-01-05T07:09:07.495102Z
true
jim-schwoebel/allie
https://github.com/jim-schwoebel/allie/blob/b89f1403f63033ad406d0606b7c7a45000b43481/augmentation/image_augmentation/helpers/imgaug/augmenters/overlay.py
augmentation/image_augmentation/helpers/imgaug/augmenters/overlay.py
"""Alias for module blend. Deprecated module. Original name for module blend.py. Was changed in 0.2.8. """ from __future__ import print_function, division, absolute_import from . import blend import imgaug as ia @ia.deprecated(alt_func="imgaug.augmenters.blend.blend_alpha()", comment="It has the exa...
python
Apache-2.0
b89f1403f63033ad406d0606b7c7a45000b43481
2026-01-05T07:09:07.495102Z
false
jim-schwoebel/allie
https://github.com/jim-schwoebel/allie/blob/b89f1403f63033ad406d0606b7c7a45000b43481/augmentation/image_augmentation/helpers/imgaug/augmentables/lines.py
augmentation/image_augmentation/helpers/imgaug/augmentables/lines.py
from __future__ import print_function, division, absolute_import import copy as copylib import numpy as np import skimage.draw import skimage.measure import cv2 from .. import imgaug as ia from .utils import normalize_shape, project_coords, interpolate_points # TODO Add Line class and make LineString a list of Lin...
python
Apache-2.0
b89f1403f63033ad406d0606b7c7a45000b43481
2026-01-05T07:09:07.495102Z
true
jim-schwoebel/allie
https://github.com/jim-schwoebel/allie/blob/b89f1403f63033ad406d0606b7c7a45000b43481/augmentation/image_augmentation/helpers/imgaug/augmentables/polys.py
augmentation/image_augmentation/helpers/imgaug/augmentables/polys.py
from __future__ import print_function, division, absolute_import import copy import warnings import numpy as np import scipy.spatial.distance import six.moves as sm import skimage.draw import skimage.measure import collections from .. import imgaug as ia from .utils import normalize_shape, interpolate_points # TOD...
python
Apache-2.0
b89f1403f63033ad406d0606b7c7a45000b43481
2026-01-05T07:09:07.495102Z
true
jim-schwoebel/allie
https://github.com/jim-schwoebel/allie/blob/b89f1403f63033ad406d0606b7c7a45000b43481/augmentation/image_augmentation/helpers/imgaug/augmentables/kps.py
augmentation/image_augmentation/helpers/imgaug/augmentables/kps.py
from __future__ import print_function, division, absolute_import import copy import numpy as np import scipy.spatial.distance import six.moves as sm from .. import imgaug as ia from .utils import normalize_shape, project_coords def compute_geometric_median(X, eps=1e-5): """ Estimate the geometric median of...
python
Apache-2.0
b89f1403f63033ad406d0606b7c7a45000b43481
2026-01-05T07:09:07.495102Z
false
jim-schwoebel/allie
https://github.com/jim-schwoebel/allie/blob/b89f1403f63033ad406d0606b7c7a45000b43481/augmentation/image_augmentation/helpers/imgaug/augmentables/segmaps.py
augmentation/image_augmentation/helpers/imgaug/augmentables/segmaps.py
from __future__ import print_function, division, absolute_import import warnings import numpy as np import six.moves as sm from .. import imgaug as ia class SegmentationMapOnImage(object): """ Object representing a segmentation map associated with an image. Attributes ---------- DEFAULT_SEGMEN...
python
Apache-2.0
b89f1403f63033ad406d0606b7c7a45000b43481
2026-01-05T07:09:07.495102Z
false
jim-schwoebel/allie
https://github.com/jim-schwoebel/allie/blob/b89f1403f63033ad406d0606b7c7a45000b43481/augmentation/image_augmentation/helpers/imgaug/augmentables/batches.py
augmentation/image_augmentation/helpers/imgaug/augmentables/batches.py
from __future__ import print_function, division, absolute_import import copy import warnings import numpy as np from .. import imgaug as ia from . import normalization as nlib DEFAULT = "DEFAULT" # TODO also support (H,W,C) for heatmaps of len(images) == 1 # TODO also support (H,W) for segmaps of len(images) == 1...
python
Apache-2.0
b89f1403f63033ad406d0606b7c7a45000b43481
2026-01-05T07:09:07.495102Z
false
jim-schwoebel/allie
https://github.com/jim-schwoebel/allie/blob/b89f1403f63033ad406d0606b7c7a45000b43481/augmentation/image_augmentation/helpers/imgaug/augmentables/utils.py
augmentation/image_augmentation/helpers/imgaug/augmentables/utils.py
from __future__ import print_function, absolute_import, division import numpy as np import six.moves as sm import imgaug as ia # TODO integrate into keypoints def normalize_shape(shape): """ Normalize a shape tuple or array to a shape tuple. Parameters ---------- shape : tuple of int or ndarray ...
python
Apache-2.0
b89f1403f63033ad406d0606b7c7a45000b43481
2026-01-05T07:09:07.495102Z
false
jim-schwoebel/allie
https://github.com/jim-schwoebel/allie/blob/b89f1403f63033ad406d0606b7c7a45000b43481/augmentation/image_augmentation/helpers/imgaug/augmentables/__init__.py
augmentation/image_augmentation/helpers/imgaug/augmentables/__init__.py
from __future__ import absolute_import from imgaug.augmentables.kps import * from imgaug.augmentables.bbs import * from imgaug.augmentables.polys import * from imgaug.augmentables.lines import * from imgaug.augmentables.heatmaps import * from imgaug.augmentables.segmaps import * from imgaug.augmentables.batches import ...
python
Apache-2.0
b89f1403f63033ad406d0606b7c7a45000b43481
2026-01-05T07:09:07.495102Z
false
jim-schwoebel/allie
https://github.com/jim-schwoebel/allie/blob/b89f1403f63033ad406d0606b7c7a45000b43481/augmentation/image_augmentation/helpers/imgaug/augmentables/heatmaps.py
augmentation/image_augmentation/helpers/imgaug/augmentables/heatmaps.py
from __future__ import print_function, division, absolute_import import numpy as np import six.moves as sm from .. import imgaug as ia class HeatmapsOnImage(object): """ Object representing heatmaps on images. Parameters ---------- arr : (H,W) ndarray or (H,W,C) ndarray Array representi...
python
Apache-2.0
b89f1403f63033ad406d0606b7c7a45000b43481
2026-01-05T07:09:07.495102Z
false
jim-schwoebel/allie
https://github.com/jim-schwoebel/allie/blob/b89f1403f63033ad406d0606b7c7a45000b43481/augmentation/image_augmentation/helpers/imgaug/augmentables/normalization.py
augmentation/image_augmentation/helpers/imgaug/augmentables/normalization.py
from __future__ import print_function, division, absolute_import import functools import numpy as np from .. import imgaug as ia from .. import dtypes as iadt def _preprocess_shapes(shapes): if shapes is None: return None elif ia.is_np_array(shapes): assert shapes.ndim in [3, 4] retu...
python
Apache-2.0
b89f1403f63033ad406d0606b7c7a45000b43481
2026-01-05T07:09:07.495102Z
true
jim-schwoebel/allie
https://github.com/jim-schwoebel/allie/blob/b89f1403f63033ad406d0606b7c7a45000b43481/augmentation/image_augmentation/helpers/imgaug/augmentables/bbs.py
augmentation/image_augmentation/helpers/imgaug/augmentables/bbs.py
from __future__ import print_function, division, absolute_import import copy import numpy as np import skimage.draw import skimage.measure from .. import imgaug as ia from .utils import normalize_shape, project_coords # TODO functions: square(), to_aspect_ratio(), contains_point() class BoundingBox(object): ""...
python
Apache-2.0
b89f1403f63033ad406d0606b7c7a45000b43481
2026-01-05T07:09:07.495102Z
true
jim-schwoebel/allie
https://github.com/jim-schwoebel/allie/blob/b89f1403f63033ad406d0606b7c7a45000b43481/augmentation/image_augmentation/helpers/imgaug/external/poly_point_isect_py2py3.py
augmentation/image_augmentation/helpers/imgaug/external/poly_point_isect_py2py3.py
# BentleyOttmann sweep-line implementation # (for finding all intersections in a set of line segments) __all__ = ( "isect_segments", "isect_polygon", # same as above but includes segments with each intersections "isect_segments_include_segments", "isect_polygon_include_segments", # for testin...
python
Apache-2.0
b89f1403f63033ad406d0606b7c7a45000b43481
2026-01-05T07:09:07.495102Z
true
jim-schwoebel/allie
https://github.com/jim-schwoebel/allie/blob/b89f1403f63033ad406d0606b7c7a45000b43481/augmentation/image_augmentation/helpers/imgaug/external/__init__.py
augmentation/image_augmentation/helpers/imgaug/external/__init__.py
python
Apache-2.0
b89f1403f63033ad406d0606b7c7a45000b43481
2026-01-05T07:09:07.495102Z
false
jim-schwoebel/allie
https://github.com/jim-schwoebel/allie/blob/b89f1403f63033ad406d0606b7c7a45000b43481/augmentation/image_augmentation/helpers/imgaug/external/opensimplex.py
augmentation/image_augmentation/helpers/imgaug/external/opensimplex.py
""" This is a copy of the OpenSimplex library, based on commit d861cb290531ad15825f21dc4cc35c5d4f407259 from 20.07.2017. """ # Based on: https://gist.github.com/KdotJPG/b1270127455a94ac5d19 import sys from ctypes import c_long from math import floor as _floor if sys.version_info[0] < 3: def floor(num): ...
python
Apache-2.0
b89f1403f63033ad406d0606b7c7a45000b43481
2026-01-05T07:09:07.495102Z
true
jim-schwoebel/allie
https://github.com/jim-schwoebel/allie/blob/b89f1403f63033ad406d0606b7c7a45000b43481/augmentation/csv_augmentation/augment_ctgan_regression.py
augmentation/csv_augmentation/augment_ctgan_regression.py
''' AAA lllllll lllllll iiii A:::A l:::::l l:::::l i::::i A:::::A l:::::l l:::::l iiii A:::::::A l:::::l l:::::l ...
python
Apache-2.0
b89f1403f63033ad406d0606b7c7a45000b43481
2026-01-05T07:09:07.495102Z
false
jim-schwoebel/allie
https://github.com/jim-schwoebel/allie/blob/b89f1403f63033ad406d0606b7c7a45000b43481/augmentation/csv_augmentation/augment_ctgan_classification.py
augmentation/csv_augmentation/augment_ctgan_classification.py
''' AAA lllllll lllllll iiii A:::A l:::::l l:::::l i::::i A:::::A l:::::l l:::::l iiii A:::::::A l:::::l l:::::l ...
python
Apache-2.0
b89f1403f63033ad406d0606b7c7a45000b43481
2026-01-05T07:09:07.495102Z
false
jim-schwoebel/allie
https://github.com/jim-schwoebel/allie/blob/b89f1403f63033ad406d0606b7c7a45000b43481/augmentation/csv_augmentation/augment.py
augmentation/csv_augmentation/augment.py
''' AAA lllllll lllllll iiii A:::A l:::::l l:::::l i::::i A:::::A l:::::l l:::::l iiii A:::::::A l:::::l l:::::l ...
python
Apache-2.0
b89f1403f63033ad406d0606b7c7a45000b43481
2026-01-05T07:09:07.495102Z
false
jim-schwoebel/allie
https://github.com/jim-schwoebel/allie/blob/b89f1403f63033ad406d0606b7c7a45000b43481/augmentation/csv_augmentation/helpers/augment_tgan.py
augmentation/csv_augmentation/helpers/augment_tgan.py
import os import pandas as pd try: from tgan.model import TGANModel except: os.system('pip3 install tgan==0.1.0') ''' following this tutorial: https://nbviewer.jupyter.org/github/aleju/imgaug-doc/blob/master/notebooks/A01%20-%20Load%20and%20Augment%20an%20Image.ipynb ''' def augment_tgan(csvfile): data=pd.read_...
python
Apache-2.0
b89f1403f63033ad406d0606b7c7a45000b43481
2026-01-05T07:09:07.495102Z
false
mohammadasim98/met3r
https://github.com/mohammadasim98/met3r/blob/3259e41b7190eaee15b09f23d252e8aaa12b15e7/setup.py
setup.py
import os from setuptools import setup, find_packages import subprocess import sys from distutils.cmd import Command with open('requirements.txt') as f: required = f.read().splitlines() __version__ = "1.0.1" class GetSubmodules(Command): def run(self): subprocess.check_call(['git', 'submodule', 'updat...
python
MIT
3259e41b7190eaee15b09f23d252e8aaa12b15e7
2026-01-05T07:13:39.862185Z
false
mohammadasim98/met3r
https://github.com/mohammadasim98/met3r/blob/3259e41b7190eaee15b09f23d252e8aaa12b15e7/test/random.py
test/random.py
import torch from met3r import MET3R import unittest class MET3RTest(unittest.TestCase): def setUp(self): self.metric = MET3R().cuda() def random_inputs(self): inputs = torch.randn((10, 2, 3, 256, 256)).cuda() inputs = inputs.clip(-1, 1) score, mask = self.metric(inputs) ...
python
MIT
3259e41b7190eaee15b09f23d252e8aaa12b15e7
2026-01-05T07:13:39.862185Z
false
mohammadasim98/met3r
https://github.com/mohammadasim98/met3r/blob/3259e41b7190eaee15b09f23d252e8aaa12b15e7/met3r/path_to_mast3r.py
met3r/path_to_mast3r.py
# Copyright (C) 2024-present Naver Corporation. All rights reserved. # Licensed under CC BY-NC-SA 4.0 (non-commercial use only). # # -------------------------------------------------------- # mast3r submodule import # -------------------------------------------------------- import sys import os.path as path HERE_PATH ...
python
MIT
3259e41b7190eaee15b09f23d252e8aaa12b15e7
2026-01-05T07:13:39.862185Z
false
mohammadasim98/met3r
https://github.com/mohammadasim98/met3r/blob/3259e41b7190eaee15b09f23d252e8aaa12b15e7/met3r/path_to_dust3r.py
met3r/path_to_dust3r.py
# Copyright (C) 2024-present Naver Corporation. All rights reserved. # Licensed under CC BY-NC-SA 4.0 (non-commercial use only). # # -------------------------------------------------------- # dust3r submodule import # -------------------------------------------------------- import sys import os.path as path HERE_PATH ...
python
MIT
3259e41b7190eaee15b09f23d252e8aaa12b15e7
2026-01-05T07:13:39.862185Z
false
mohammadasim98/met3r
https://github.com/mohammadasim98/met3r/blob/3259e41b7190eaee15b09f23d252e8aaa12b15e7/met3r/__init__.py
met3r/__init__.py
from .met3r import MEt3R
python
MIT
3259e41b7190eaee15b09f23d252e8aaa12b15e7
2026-01-05T07:13:39.862185Z
false
mohammadasim98/met3r
https://github.com/mohammadasim98/met3r/blob/3259e41b7190eaee15b09f23d252e8aaa12b15e7/met3r/met3r.py
met3r/met3r.py
import sys import os import os.path as path from typing import Literal, Optional, Union import torch from torch import Tensor from torch.nn import Identity, functional as F from pathlib import Path from torch.nn import Module from jaxtyping import Float, Bool from typing import Union, Tuple from einops import rear...
python
MIT
3259e41b7190eaee15b09f23d252e8aaa12b15e7
2026-01-05T07:13:39.862185Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/people/wu_ros_tools/manifest_cleaner/scripts/stats.py
people/wu_ros_tools/manifest_cleaner/scripts/stats.py
#!/usr/bin/python import rospy import xml.dom.minidom import os import os.path import sys import collections import operator from urlparse import urlparse import httplib def get_code(url): x = urlparse(url) try: conn = httplib.HTTPConnection(x.netloc) conn.request("HEAD", x.path) ret...
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/people/wu_ros_tools/catkinize_this/scripts/catkinize_this.py
people/wu_ros_tools/catkinize_this/scripts/catkinize_this.py
#!/usr/bin/python import rospy from xml.dom import minidom import subprocess import os.path found = {} def get_root(package): p = subprocess.Popen(['rospack', 'find', package], stdout=subprocess.PIPE, stderr=subprocess.PIPE) out, err = p.communicate() return out.strip() def is_catkinized(package, root=N...
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/people/wu_ros_tools/joy_listener/setup.py
people/wu_ros_tools/joy_listener/setup.py
#!/usr/bin/env python from distutils.core import setup from catkin_pkg.python_setup import generate_distutils_setup package_info = generate_distutils_setup( packages=['joy_listener'], package_dir={'': 'src'}, ) setup(**package_info)
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/people/wu_ros_tools/joy_listener/src/joy_listener/__init__.py
people/wu_ros_tools/joy_listener/src/joy_listener/__init__.py
import roslib; roslib.load_manifest('joy_listener') import rospy from sensor_msgs.msg import Joy class JoyListener(dict): def __init__(self, wait_time=1.0, joy_topic='/joy'): self.wait_time = wait_time self.sub = rospy.Subscriber(joy_topic, Joy, self.joy_cb, queue_size=1) self.last_time = r...
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/people/wu_ros_tools/rosbaglive/scripts/play.py
people/wu_ros_tools/rosbaglive/scripts/play.py
#!/usr/bin/python import rospy import rosbag import sys # F#@K IT WE'LL DO IT LIVE if __name__=='__main__': rospy.init_node('rosbaglive') bagfn = None should_loop = False loop_sleep = 0.1 for arg in sys.argv[1:]: if ".bag" in arg: bagfn = arg elif arg=='-l': ...
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/people/wu_ros_tools/easy_markers/setup.py
people/wu_ros_tools/easy_markers/setup.py
#!/usr/bin/env python from distutils.core import setup from catkin_pkg.python_setup import generate_distutils_setup package_info = generate_distutils_setup( packages=['easy_markers'], package_dir={'': 'src'}, ) setup(**package_info)
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/people/wu_ros_tools/easy_markers/scripts/interactive_marker_demo.py
people/wu_ros_tools/easy_markers/scripts/interactive_marker_demo.py
#!/usr/bin/python import rospy from easy_markers.interactive import InteractiveGenerator def callback(feedback): print feedback if __name__=='__main__': rospy.init_node('itest') ig = InteractiveGenerator() ig.makeMarker(controls=["move_x", "rotate_x"]) ig.makeMarker(controls=["move_y", "rotate_y...
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/people/wu_ros_tools/easy_markers/scripts/std_marker_demo.py
people/wu_ros_tools/easy_markers/scripts/std_marker_demo.py
#!/usr/bin/python import rospy from easy_markers.generator import * if __name__=='__main__': rospy.init_node('some_markers') pub = rospy.Publisher('/visualization_marker', Marker) gen = MarkerGenerator() gen.ns = '/awesome_markers' gen.type = Marker.SPHERE_LIST gen.scale = [.3]*3 gen.frame...
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false