sudo apt-get install python3-pip
sudo pip3 install virtualenv
| @echo OFF | |
| rem How to run a Python script in a given conda environment from a batch file. | |
| rem It doesn't require: | |
| rem - conda to be in the PATH | |
| rem - cmd.exe to be initialized with conda init | |
| rem Define here the path to your conda installation | |
| set CONDAPATH=C:\ProgramData\Miniconda3 | |
| rem Define here the name of the environment |
| #from __future__ import absolute_import | |
| from keras.preprocessing.image import ImageDataGenerator, array_to_img, img_to_array, load_img | |
| from keras.callbacks import ModelCheckpoint | |
| from keras.models import Sequential | |
| from keras.layers import Convolution2D, MaxPooling2D | |
| from keras.layers import Layer, Dense, Dropout, Activation, Flatten, Reshape, Merge, Permute | |
| from keras.layers import ZeroPadding2D, UpSampling2D | |
| from keras.layers.normalization import BatchNormalization | |
| import sys |
| from matplotlib import pyplot as plt | |
| import cv2 | |
| img = cv2.imread('/Users/mustafa/test.jpg') | |
| gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) | |
| plt.imshow(gray) | |
| plt.title('my picture') | |
| plt.show() |
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| from flask import Flask, stream_with_context, request, Response, flash | |
| from time import sleep | |
| app = Flask(__name__) | |
| def stream_template(template_name, **context): |
| def add_cors_headers(response): | |
| response.headers['Access-Control-Allow-Origin'] = '*' | |
| if request.method == 'OPTIONS': | |
| response.headers['Access-Control-Allow-Methods'] = 'DELETE, GET, POST, PUT' | |
| headers = request.headers.get('Access-Control-Request-Headers') | |
| if headers: | |
| response.headers['Access-Control-Allow-Headers'] = headers | |
| return response | |
| app.after_request(add_cors_headers) |