This file contains 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
const hiraganaToRomajiMap: Map<string, string> = new Map([ | |
['あ', 'a'], | |
['い', 'i'], | |
['う', 'u'], | |
['え', 'e'], | |
['お', 'o'], | |
['か', 'ka'], | |
['き', 'ki'], | |
['く', 'ku'], | |
['け', 'ke'], |
This file contains 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
a | |
b | |
c | |
d | |
e | |
f | |
g | |
h | |
i | |
j |
This file contains 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
int rows, cols; | |
int scl = 20; | |
int w = 2920; | |
int h = 1080; | |
float flying = 0; | |
// 2d array in java | |
float[][] terrain; |
This file contains 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 numpy as np | |
from tqdm import tqdm | |
import torch | |
import torch.nn as nn | |
import torch.nn.functional as F | |
import torch.optim as optim | |
REBUILD_DATA = False # set to true to one once, then back to false unless you want to change something in your training data. |
This file contains 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
# Ping PLC | |
ping -t 10.114.4.10 > C:\Users\apynch\Github\scripts\ignition.txt | |
# Ping google | |
ping -t google.com > C:\Users\apynch\Github\scripts\google.txt |
This file contains 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
new_q = (1 - LEARNING_RATE) * current_q + LEARNING_RATE * (reward + DISCOUNT * max_future_q) | |
q_table[observation][action] = reward |
This file contains 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 crop_lower_half(fnames): # fnames is a list of jpg names in a folder | |
for i, file in enumerate(fnames): | |
cropped_image = crop(open_image(jpg_extractions[i]), 1910, 1.29995, 0) | |
print(i) | |
print(file) | |
cropped_image.save("/home/andrew/Github/neuralink-bot/image_manipulation/cropped_jpgs/top_crop/top_crop_%s.jpg" % (str(i))) |
This file contains 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 sys | |
sys.path.remove('/opt/ros/kinetic/lib/python2.7/dist-packages') | |
import cv2 | |
vidcap = cv2.VideoCapture('neuralink3.mp4') | |
success,image = vidcap.read() | |
count = 0 | |
while success: |
This file contains 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 order_files_by_date(path_to_folder, file_type): | |
files = glob.glob("%s*%s" % (path_to_folder, file_type)) | |
files.sort(key=os.path.getmtime) | |
return files |