for f in ./*.mp4; do echo "file '$PWD/$f'" >> file.txt ; done
for f in ./*.mp4; do echo "file '$PWD/$f'" >> file.txt ; done
import pickle
import numpy as np
import glob, gzip
import multiprocessing as mp
from functools import partial
import tqdm
def daemon(paths, idx):
item = paths[idx].split(' ')
data = pickle.load(gzip.open(item[0], 'rb'))
images = data.astype(np.float32)
print(item[0], images.shape)
root = '/data/ninja/workspace/data/boyshome/train.txt'
ifile = open(root)
files = ifile.readlines()
indices = list(range(len(files)))
worker = partial(daemon, files)
pool = mp.Pool(24)
tqdm.tqdm(pool.map(func=worker, iterable=indices))
pool.close()
pool.join()
for i in *.avi; do ffmpeg -i "$i" -vcodec libx264 "${i%.*}_.mp4"; done
(base) temp@temp:~/temp$ rm -r ./*
bash: /bin/rm: Argument list too long
(base) temp@temp:~/temp$ find . -type f -name '*.*' | xargs rm
(base) temp@temp:~/temp$ ls
eog image.jpg
evince file.pdf
Ref: https://docs.nvidia.com/datacenter/tesla/tesla-installation-notes/index.html
This section includes instructions for installing the NVIDIA driver on Ubuntu 16.04 LTS and Ubuntu 18.04 LTS distributions using the package manager.
$ sudo apt-get install linux-headers-$(uname -r)
$ distribution=$(. /etc/os-release;echo $ID$VERSION_ID | sed -e 's/\.//g')
$ wget https://developer.download.nvidia.com/compute/cuda/repos/$distribution/x86_64/cuda-$distribution.pin
$ sudo mv cuda-$distribution.pin /etc/apt/preferences.d/cuda-repository-pin-600
$ sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/$distribution/x86_64/7fa2af80.pub
$ echo "deb http://developer.download.nvidia.com/compute/cuda/repos/$distribution/x86_64 /" | sudo tee /etc/apt/sources.list.d/cuda.list
$ sudo apt-get update
$ sudo apt-get -y install cuda-drivers
from sklearn.metrics import accuracy_score, confusion_matrix, classification_report
def indices_to_one_hot(data, nb_classes):
"""Convert an iterable of indices to one-hot encoded labels."""
targets = np.array(data).reshape(-1)
return np.eye(nb_classes)[targets]
def one_hot_to_indices(data):
return np.argmax(data, axis=1)
#########################################