This file contains hidden or 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
| $ django-admin startproject <your-api-name> | |
| $ cd <your-api-name> | |
| $ python manage.py runserver |
This file contains hidden or 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 matplotlib.pyplot as plt | |
| import pandas as pd | |
| def draw_boxplot_numerical_categorical_cols(df, numerical_col, categorical_col): | |
| categories = [] | |
| for category in df[categorical_col].unique(): | |
| categories.append({ | |
| 'categorical_col': category, | |
| 'numerical_col': df[df[categorical_col] == category][numerical_col]}) | |
This file contains hidden or 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
| # install dependencies by conda | |
| conda install -c conda-forge imageio | |
| conda install scikit-image | |
| from imageio import imread | |
| from skimage.transform import resize | |
| img = imread(file_path) | |
| img_resized = resize(img, (128, 128)) |
This file contains hidden or 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
| def load_image_dataset(dir_path='datasets/train/', dataset_size=None, | |
| size=(300, 300)): | |
| """ | |
| Resize all the images in the specifed directory to the specified | |
| (height, width) as X and their corresponding labels as y. Where | |
| `y = 0` indicate it's a dog image while `y = 1` indicate cat image. | |
| Parameters: | |
| ----------- | |
| dir_path: relative path to image folder |
This file contains hidden or 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
| <div class="row"> | |
| <div class="col-md-6"> | |
| <div> | |
| <img src="{{cur_image_path}}" class="img-responsive"> | |
| </div> | |
| </div> | |
| </div> |
This file contains hidden or 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
| References | |
| - https://stackoverflow.com/questions/24383700/resize-image-in-the-wiki-of-github-using-markdown | |
| <img src="images/cover.png" alt="Cover" width="50%"/> |
This file contains hidden or 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
| git clone https://gist.github.com/<hash>.git | |
| git add your-image.jpg | |
| git commit -m "Add image" | |
| git push origin master |
This file contains hidden or 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
| # References | |
| # https://stackoverflow.com/questions/9166400/convert-rgba-png-to-rgb-with-pil | |
| from PIL import Image | |
| def get_rgb_image(file_path, delete_original_image=True): | |
| """ | |
| Remove image's alpha channel and return the path of the | |
| transformed image |
This file contains hidden or 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
| pip install awscli --upgrade | |
| aws configure --profile personal |
This file contains hidden or 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
| brew install heroku/brew/heroku |
OlderNewer