sudo dnf -y install dnf-plugins-core
sudo dnf config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo
sudo dnf config-manager --set-enabled docker-ce-test
sudo dnf config-manager --set-disabled docker-ce-stable
| wget http://get.docker.com -O docker-install.sh | |
| sudo chmod +x docker-install.sh | |
| ./docker-install.sh | |
| sudo groupadd docker | |
| sudo usermod -aG docker $USER | |
| sudo systemctl enable docker | |
| sudo apt-get install -y install docker-compose | |
| sudo reboot |
| #1. Update system | |
| sudo apt-get update | |
| #2.Install packages to allow apt to use a repository over HTTPS: | |
| sudo apt-get install \ | |
| apt-transport-https \ | |
| ca-certificates \ | |
| curl \ | |
| software-properties-common |
| #!/bin/bash | |
| if [ -d ~/miniconda3 ] | |
| then | |
| echo "Deleting directory ~/miniconda3..." | |
| rm -rf ~/miniconda3 ~/.conda |
| #@title Dataset info { form-width: "800px" } | |
| # e.g GOOGLE_DRIVE_FILE_URL: https://drive.google.com/open?id=1CZyDkHHjS8SUVBF7fBwoTAF6xSpLmD4P7 | |
| LinkFile = "GOOGLE_DRIVE_FILE_URL" #@param {type:"string"} | |
| # e.g GOOGLE_DRIVE_FILENAME_WITH_EXTENSION: Local History.csv | |
| Filename = "GOOGLE_DRIVE_FILENAME_WITH_EXTENSION" #@param {type:"string"} | |
| Filename = Filename.replace(' ', '\ ') |
| '''Train a Siamese MLP on pairs of digits from the MNIST dataset. | |
| It follows Hadsell-et-al.'06 [1] by computing the Euclidean distance on the | |
| output of the shared network and by optimizing the contrastive loss (see paper | |
| for mode details). | |
| [1] "Dimensionality Reduction by Learning an Invariant Mapping" | |
| http://yann.lecun.com/exdb/publis/pdf/hadsell-chopra-lecun-06.pdf | |
| Run on GPU: THEANO_FLAGS=mode=FAST_RUN,device=gpu,floatX=float32 python mnist_siamese_graph.py |
| import matplotlib.pyplot as plt | |
| from mpl_toolkits.axes_grid1 import ImageGrid | |
| import numpy as np | |
| import PIL | |
| import cv2 | |
| import glob | |
| import os | |
| def apply_plot_style(xlim, ylim, xlabel, ylabel, grid): | |
| plt.clf() |
| import matplotlib.pyplot as plt | |
| from mpl_toolkits.axes_grid1 import ImageGrid | |
| import numpy as np | |
| import PIL | |
| def thumb_grid(im_list, grid_shape, fname_out, scale=1.0, axes_pad=0.07, figsize=(7, 7), dpi=900): | |
| assert len(grid_shape) == 2 # Grid must be 2D: | |
| assert np.prod(grid_shape) >= len(im_list) # Make sure all images can fit in grid: | |
| plt.figure(figsize=figsize, dpi=dpi) |
| import cv2 | |
| import numpy as np | |
| screen_width, screen_height = 1920, 1080 | |
| window_width, window_height = 1270, 720 | |
| path = "template.jpeg" | |
| image = cv2.imread(path) | |
| image_width, image_height = image.shape[:2] |
| #!/bin/bash | |
| # Delete all containers | |
| docker rm $(docker ps -a -q) | |
| # Delete all images | |
| docker rmi $(docker images -q) |