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
# Load various colour hacks for the terminal | |
load_colours() | |
{ | |
# From https://stackoverflow.com/a/28938235 | |
# Reset | |
NC='\033[0m' # Text Reset | |
# Regular Colors | |
Black='\033[0;30m' # Black | |
Red='\033[0;31m' # Red |
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
choco install chocolatey chocolatey-core.extension -y | |
choco install googlechrome firefox office365proplus -y | |
choco install adobereader 7zip vlc ccleaner teracopy bulk-crap-uninstaller -y | |
:: Optional | |
choco install aria2 google-backup-and-sync skype dropbox -y | |
choco install greenshot f.lux -y | |
choco install bitwarden keepass -y | |
:: Optional – 2 |
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
#!/bin/bash | |
sudo apt-get install git cmake build-essential bison -y | |
sudo apt-get install gcc-4.8 g++-4.8 -y # For nvcc | |
mkdir ITK_RTK | |
# Install ITK | |
git clone git://itk.org/ITK.git | |
cd ITK && git checkout v4.13.0 && cd ../ | |
mkdir -p ITK-bin && cd ITK-bin |
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 subprocess as sp | |
with open("temp_files.txt", "w") as f: | |
for t in ["output_{}.avi".format(i) for i in range(num_processes)]: | |
f.write("file {} \n".format(t)) | |
ffmpeg_command = "ffmpeg -f concat -safe 0 -i temp_files.txt -vcodec copy" | |
sp.Popen(ffmpeg_command, shell=True).wait() |
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 process_video(group_number): | |
cap = cv2.VideoCapture("input_file.mp4") | |
cap.set(cv2.CAP_PROP_POS_FRAMES, frame_jump * group_number) | |
proc_frames = 0 | |
out = cv2.VideoWriter("output_{}.avi".format(group_number), ...) | |
while proc_frames < frame_jump: | |
ret, frame = cap.read() | |
# ... DO SOME STUFF TO frame ... # | |
proc_frames += 1 | |
out.write(frame) |
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 process_video(): | |
cap = cv2.VideoCapture("input_file.mp4") # Define the input video handler | |
out = cv2.VideoWriter("output_file.avi", ...) # Define the output video handler | |
while (cap.isOpened()): # Loop through the video frames | |
ret, frame = cap.read() # Read a frame | |
# ... DO SOME STUFF TO frame... # # Perform some operation | |
out.write(frame) # Define the input video handler | |
process_video() # Call the actual function |
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
#!/bin/bash | |
# Build Zsh from sources on Ubuntu. | |
# From http://zsh.sourceforge.net/Arc/git.html and sources INSTALL file. | |
execute () { | |
echo "$ $*" | |
OUTPUT=$($@ 2>&1) | |
if [ $? -ne 0 ]; then | |
echo "$OUTPUT" | |
echo "" |