Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

web deploy #82

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions app/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,17 @@
from fastai import *
from fastai.vision import *
from io import BytesIO
from pathlib import Path
from starlette.applications import Starlette
from starlette.middleware.cors import CORSMiddleware
from starlette.responses import HTMLResponse, JSONResponse
from starlette.staticfiles import StaticFiles
import sys

export_file_url = 'https://www.dropbox.com/s/6bgq8t6yextloqp/export.pkl?raw=1'
export_file_url = 'https://drive.google.com/uc?export=download&id=1EXIrm0PYJ5-nFWnNgWkWTx9yFdgp_niW'
export_file_name = 'export.pkl'

classes = ['black', 'grizzly', 'teddys']
classes = ['alienware', 'macbook', 'razer']
path = Path(__file__).parent

app = Starlette()
Expand Down
10 changes: 5 additions & 5 deletions app/static/style.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
body {
background-color: #fff;
background-color: rgb(77, 74, 74);
}

.no-display {
Expand All @@ -17,7 +17,7 @@ body {
font-size: 30px;
margin-top: 1em;
margin-bottom: 1em;
color: #262626;
color: #43b643b6;
}

.content {
Expand All @@ -43,10 +43,10 @@ button.choose-file-button {
width: 200px;
height: 40px;
border-radius: 2px;
background-color: #ffffff;
border: solid 1px #7052CB;
background-color: #69666669;
border: solid 1px rgb(0, 0, 0);
font-size: 13px;
color: #7052CB;
color: #43b643b6;
}

button.analyze-button {
Expand Down
10 changes: 7 additions & 3 deletions app/view/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,14 @@
<body>
<div>
<div class='center'>
<div class='title'>Classify Bear Images 🐻</div>
<div class='title'>Accurately Identify Laptop Brands</div>
<p>
Use images of <strong>teddy</strong> bears, <strong>black</strong> bears, <strong>grizzly</strong> bears, or
all three!
Use images of <strong>Macbooks</strong>, <strong>Razer Blades</strong>,
<strong>Alienwares</strong>, or all three!
</p>
<p>
This classifier was built as a personal project inspired by Lesson 2
of the fastai course v3 (2019).
</p>
<div class='content'>
<div class='no-display'>
Expand Down
6 changes: 3 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ aiofiles==0.5.0
aiohttp==3.6.2
asyncio==3.4.3
fastai==1.0.61
torch==1.6.0
torchvision==0.7.0
torch==1.4.0
torchvision==0.5.0
numpy==1.19.0
pillow~=7.2
pillow==7.2
python-multipart==0.0.5
starlette==0.13.6
uvicorn==0.11.7