File > Open ...- Launch new terminal instance:
New > Terminal - tarball the folder:
tar czvhf coursera.tar.gz *- a. split it (usually this file might be too large for your instance to allow download)
split -b 90M -d coursera.tar.gz coursera.File > Open ...New > Terminaltar czvhf coursera.tar.gz *split -b 90M -d coursera.tar.gz coursera.| web: sh setup.sh && streamlit run RGB_web_app.py |
| mkdir -p ~/.streamlit | |
| echo "[server] | |
| headless = true | |
| port = $PORT | |
| enableCORS = false | |
| " > ~/.streamlit/config.toml |
| # -*- coding: utf-8 -*- | |
| import streamlit as st | |
| import PIL | |
| from PIL import Image, ImageOps | |
| from color_classifier import predict_color #importing predicting color function | |
| # display image with the size and rgb color | |
| def display_image(): | |
| img = Image.new("RGB", (200, 200), color=(Red,Green,Blue)) | |
| img = ImageOps.expand(img, border=1, fill='black') # border to the img |
| # -*- coding: utf-8 -*- | |
| ## Importing Libraries | |
| import numpy as np | |
| # Importing Tensorflow | |
| import tensorflow as tf | |
| from tensorflow import keras | |
| from tensorflow.keras import layers |
| !pip install pyyaml h5py # Required to save models in HDF5 format |
| absl-py==0.10.0 | |
| altair==4.1.0 | |
| argon2-cffi==20.1.0 | |
| astor==0.8.1 | |
| astunparse==1.6.3 | |
| attrs==20.1.0 | |
| backcall==0.2.0 | |
| base58==2.0.1 | |
| bleach==3.1.5 | |
| blinker==1.4 |
| #Classification Report | |
| target_names = ['Red', 'Green', 'Blue', 'Yellow', 'Orange', 'Pink', 'Purple', 'Brown', 'Grey', 'Black', 'White'] | |
| print(classification_report(actual_encoded_test_labels, predicted_encoded_test_labels, target_names=target_names)) |
| from sklearn.metrics import confusion_matrix, classification_report | |
| confusion_matrix_test = confusion_matrix(actual_encoded_test_labels, predicted_encoded_test_labels) | |
| f,ax = plt.subplots(figsize=(16,12)) | |
| categories = ['Red', 'Green', 'Blue', 'Yellow', 'Orange', 'Pink', 'Purple', 'Brown', 'Grey', 'Black', 'White'] | |
| sns.heatmap(confusion_matrix_test, annot=True, cmap='Blues', fmt='d', | |
| xticklabels = categories, | |
| yticklabels = categories) | |
| plt.show() |
| model.evaluate(x=test_dataset, y=test_labels) |