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
## Fresh install of Ubuntu 16.04 | |
## Note I have copied much of this by hand - be wary of subtle typos! | |
# Get a proper browser. | |
cd ~ | |
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add - | |
echo 'deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main' | sudo tee /etc/apt/sources.list.d/google-chrome.list | |
sudo apt-get update | |
sudo apt-get install google-chrome-stable -y |
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 video.mp4 -f mp3 -ab 192000 -vn music.mp3 | |
ffmpeg -i video.mp4 -i music.mp3 -codec copy -shortest video_with_audio.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
ffmpeg -r 25 -f image2 -s 640x360 -i image_%04d.png -vcodec libx264 -crf 25 -pix_fmt yuv420p name_of_output_file.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
cd pix2pix-tensorflow | |
python3 tools/process.py --input_dir path/to/edges/images --b_dir path/to/original/images --operation combine --output_dir edge2image |
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
start_frame = | |
end_frame = | |
for image in range(start_frame, end_frame): | |
file_name = 'edge2image_test/images/image_{num:04d}'.format(num=image) | |
input_file = cv2.imread(file_name + '-inputs.png') | |
output_file = cv2.imread(file_name + '-outputs.png') | |
target_file = cv2.imread(file_name + '-targets.png') | |
save_file = np.hstack((input_file, output_file, target_file)) | |
save_name = file_name + '.png' |
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 numpy as np | |
import cv2 | |
import os | |
def auto_canny(image, sigma=0.33): | |
median = np.median(image) | |
lower = int(max(0, (1.0 - sigma) * median)) | |
upper = int(min(255, (1.0 + sigma) * median)) | |
return cv2.Canny(image, lower, upper) |
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 downloaded_file.mp4 -vf scale=640x360 path/to/frames/folder/image_%04d.png |
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
youtube-dl https://www.youtube.com/path/to/your/video/here |
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_differential_evolution(solution_size=5, | |
population_size=1000, | |
iteration_count=100, | |
print_results=False, | |
differential_weight=1.0, | |
crossover_probability=0.5, | |
lower=0.0, | |
upper=1.0): | |
while population_size % 3 != 0: |
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
string = "took {}s to run population size of {} for {} iterations" | |
population_size = 500 | |
iteration_count = 100 | |
solution_size = 64 * 64 | |
# Naive DFO | |
with tf.device("/cpu:0"): | |
start = time.time() | |
naive_dfo(solution_size=solution_size, |