Host juwels
HostName juwels.fz-juelich.de
User salaj1
IdentityFile ~/.ssh/id_rsa_juwels.pub
To connect simply ssh juwels.
| import os | |
| import cv2 | |
| dir_files = os.listdir('raw_data') | |
| extensions = [filename[-4:] for filename in dir_files] | |
| for ext in extensions: | |
| assert ext == '.jpg' | |
| max_width = 0 |
| import json | |
| import sys | |
| import os | |
| folders = [] | |
| files = [] | |
| RESULT_KEY = 'test_per' | |
| data = { | |
| 'subdir1': [], | |
| 'subdir2': [], |
| #!/usr/bin/python | |
| #!/usr/bin/python | |
| # Answer to this: | |
| # https://stackoverflow.com/questions/53442614/conways-game-of-life-in-python-3-with-matplotlib-problem-with-displaying-a-fo#53442614 | |
| # call with: python3 cgl.py 10 500 1 1 | |
| import os | |
| import argparse | |
| import numpy as np |
| import nltk | |
| from nltk.parse.generate import generate | |
| # Define Reber grammar | |
| # http://christianherta.de/lehre/dataScience/machineLearning/neuralNetworks/pics/embeddedReberGrammar.png | |
| grammarStr = ''' | |
| START -> 'B' 'T' REBER 'T' 'E' | 'B' 'P' REBER 'P' 'E' | |
| REBER -> 'B' E1 | |
| E1 -> 'T' E2 | 'P' E3 |
| import cv2 | |
| import numpy as np | |
| print(cv2.__version__) | |
| vidcap = cv2.VideoCapture('vid.mp4') | |
| success,image = vidcap.read() | |
| count = 0 | |
| success = True | |
| frames = [] | |
| while success: | |
| frames.append(image) |
| # install Anaconda to control the environment: https://www.anaconda.com/distribution/#linux | |
| wget https://repo.anaconda.com/archive/Anaconda3-2018.12-Linux-x86_64.sh | |
| chmod +x Anaconda3-2018.12-Linux-x86_64.sh | |
| ./Anaconda3-2018.12-Linux-x86_64.sh | |
| # answer to the installation prompts | |
| # activate environment and install the required libraries | |
| conda create -n vid2frame | |
| conda activate vid2frame | |
| conda install opencv scipy |
| # # First create and activate conda python3 environment: | |
| # conda create -n video python=3.6 | |
| # conda activate video | |
| # # Then install the requirements: | |
| # conda install ffmpeg | |
| # conda install tensorflow-gpu==1.13.1 | |
| # pip install tensorflow_datasets | |
| # # The bellow code would still produce an error because of the missing file ("ucf101_labels.txt") | |
| # # So manually download the "ucf101_labels.txt" and put it in place: | |
| # cd "/home/$USER/anaconda3/envs/video/lib/python3.6/site-packages/tensorflow_datasets/video/" |
| def find_onset_offset(y, threshold): | |
| """ | |
| Given the input signal `y` with samples, | |
| find the indices where `y` increases and descreases through the value `threshold`. | |
| Return stacked binary arrays of shape `y` indicating onset and offset threshold crossings. | |
| `y` must be 1-D numpy arrays. | |
| """ | |
| if threshold == 1: | |
| equal = y == threshold | |
| transition_touch = np.where(equal)[0] |
| # Steps for setting up python jupyter notebook for editing over SSH | |
| # this is not a runnable script as different commands need to be executed on different machines | |
| # ON REMOTE MACHINE | |
| ssh username@remotepc123 | |
| # make sure the jupyter is installed | |
| pip install jupyter | |
| # start jupyter on specified port and no-browser mode | |
| jupyter notebook --no-browser --port=8080 | |
| # copy the url with token that looks something like this: |