Finite State Machine based on youtube video
The same solution splited to modules is here
from random import randint
from time import sleep
# _____________________________________________________
State = type("State", (object,), {})
def seqToArray(path): | |
data = [] | |
for i in range(1491): | |
if os.listdir(path)[0][-3:] == 'jpg': | |
data.append(array(Image.open(path + '{}'.format(i+1) + '.jpg'))) | |
elif os.listdir(path)[0][-3:] == 'png': | |
data.append(array(Image.open(path + '{}'.format(i+1) + '.png'))) | |
else : | |
print('there is no "jpg" jr "png" inside') | |
return data |
import numpy as np | |
import keras | |
from keras.models import Sequential | |
from keras.layers import Dense, Dropout, Flatten | |
from keras.layers import Conv2D, MaxPooling2D | |
from keras.optimizers import SGD | |
# Generate dummy data | |
x_train = np.random.random((100, 100, 100, 3)) | |
y_train = keras.utils.to_categorical(np.random.randint(10, size=(100, 1)), num_classes=10) |
def Dijkstra(N, S, matrix): | |
valid = [True] * N | |
weight = [1000000] * N | |
weight[S] = 0 | |
for i in range(N): | |
min_weight = 1000001 | |
ID_min_weight = -1 | |
for i in range(len(weight)): | |
if valid[i] and weight[i] < min_weight: | |
min_weight = weight[i] |
Youtube: | |
https://www.youtube.com/watch?v=c0i88t0Kacs (Синематик к игре Witcher 3) | |
https://www.youtube.com/watch?v=aUqW4S4jOy4 (Ролик о создании синематика) | |
https://www.youtube.com/watch?v=Bko6U5cTROE (Бенедикт в роли дракона) | |
https://www.youtube.com/watch?v=1wK1Ixr-UmM («Аватар», креативность вдохновляет технологии) | |
https://www.youtube.com/watch?v=wdedV81UQ5k ("A computer animated hand" - Первый компьютерный анимационный фильм 1972) | |
Apps: | |
Blender - https://www.blender.org/ (открытое, мощное решение для создание компьютерной графики, поддерживает Python) | |
Faceshift (Швейцарская компания / поглощена Apple / разработки задействованы в iPhone 10 и более поздних версиях) |
open current directory | |
explorer.exe `wslpath -w "$PWD"` |
#1 - should be enough | |
sudo setfacl -m user:$USER:rw /var/run/docker.sock | |
#2 | |
sudo usermod -aG docker $USER | |
#3 | |
sudo groupadd docker | |
sudo gpasswd -a $USER docker |
git filter-branch --index-filter 'git rm -rf --cached --ignore-unmatch path_to_file' HEAD |
video to gif | |
``` | |
ffmpeg -ss 0 -t 10 -i enter.mp4 -vf "fps=10,scale=500:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" -loop 0 enter.gif | |
``` |
# reduce animation | |
dconf write /org/gnome/desktop/interface/enable-animations false |