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
from keras.preprocessing.image import ImageDataGenerator | |
# Rescaling all images by 1/255 | |
train_datagen = ImageDataGenerator(rescale=1./255) | |
test_datagen = ImageDataGenerator(rescale=1./255) | |
train_generator = train_datagen.flow_from_directory( | |
directory=TRAIN_DIR, | |
target_size=(150, 150), # Resizing all images to 150 x 150 | |
batch_size=20, |
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
from keras import models | |
from keras import layers | |
model = models.Sequential() | |
model.add(layers.Conv2D( | |
filters=32, | |
kernel_size=(3, 3), | |
strides=(1, 1), | |
padding='valid', |
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
DATASET_DIR = 'your-dataset-directory' | |
BASE_DIR = os.getcwd() + '\\trainset' | |
os.mkdir(BASE_DIR) | |
TRAIN_DIR = os.path.join(BASE_DIR, 'train') | |
TRAIN_DOGS_DIR = os.path.join(TRAIN_DIR, 'dogs') | |
TRAIN_CATS_DIR = os.path.join(TRAIN_DIR, 'cats') | |
os.mkdir(TRAIN_DIR) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
server { | |
listen 1222; | |
listen [::]:1222; | |
location / { | |
proxy_pass http://0.0.0.0:8888; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header Host $http_host; | |
proxy_http_version 1.1; | |
proxy_redirect off; |
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
[program:jupyter] | |
directory=/home/ubuntu/jupyter-notebooks/ | |
command=sudo jupyter notebook --allow-root --config=/home/ubuntu/.jupyter/jupyter_notebook_config.py | |
autostart=true | |
autorestart=true | |
stderr_logfile=/var/log/jupyter.err.log | |
stdout_logfile=/var/log/jupyter.out.log |
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 threading | |
import time | |
import requests | |
import json | |
import subprocess | |
def torrent(port): | |
command = subprocess.Popen(['qbittorrent-nox', f'--webui-port={port}']) | |
def ngrok(port): |
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
TOKEN = "YOUR TOKEN HERE" | |
def install_ngrok(): | |
import os | |
from zipfile import ZipFile | |
from urllib.request import urlretrieve | |
url = 'https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip' | |
urlretrieve(url, 'ngrok-amd64.zip') | |