Spaces:
Sleeping
Sleeping
deploy at 2025-05-14 12:23:01.481163
Browse files- drop.jpg +0 -0
- export.pkl +2 -2
- export.py +4 -0
- main.py +2 -7
- requirements.txt +5 -4
drop.jpg
CHANGED
|
|
export.pkl
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:940fbdd56360e09e7e90ce8d2b3c0942c0371330c261f0a33afac2410e44fc07
|
| 3 |
+
size 46976702
|
export.py
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from fastai.vision.all import load_learner
|
| 2 |
+
#learn = load_learner('export.pkl', cpu=True)
|
| 3 |
+
learn = load_learner('export-py11.pkl', cpu=True)
|
| 4 |
+
learn.export('export-py11.pkl')
|
main.py
CHANGED
|
@@ -4,12 +4,7 @@ from PIL import Image
|
|
| 4 |
from io import BytesIO
|
| 5 |
from starlette.responses import JSONResponse
|
| 6 |
from fasthtml_hf import setup_hf_backup
|
| 7 |
-
import os
|
| 8 |
-
import inspect
|
| 9 |
import traceback
|
| 10 |
-
import torch
|
| 11 |
-
import fastai
|
| 12 |
-
import sys
|
| 13 |
|
| 14 |
app, rt = fast_app(pico=False, hdrs=(
|
| 15 |
Script(src="https://cdn.tailwindcss.com?plugins=forms,typography"),
|
|
@@ -235,10 +230,10 @@ def get(filename: str = "black.jpg"):
|
|
| 235 |
return Div(
|
| 236 |
Div(
|
| 237 |
# Success icon
|
| 238 |
-
NotStr('<svg class="w-12 h-12 text-green-500 mx-auto mb-
|
| 239 |
|
| 240 |
# Results
|
| 241 |
-
H3('Analysis Complete', cls="text-lg font-medium text-gray-700 text-center mb-
|
| 242 |
|
| 243 |
# Prediction image
|
| 244 |
Div(
|
|
|
|
| 4 |
from io import BytesIO
|
| 5 |
from starlette.responses import JSONResponse
|
| 6 |
from fasthtml_hf import setup_hf_backup
|
|
|
|
|
|
|
| 7 |
import traceback
|
|
|
|
|
|
|
|
|
|
| 8 |
|
| 9 |
app, rt = fast_app(pico=False, hdrs=(
|
| 10 |
Script(src="https://cdn.tailwindcss.com?plugins=forms,typography"),
|
|
|
|
| 230 |
return Div(
|
| 231 |
Div(
|
| 232 |
# Success icon
|
| 233 |
+
NotStr('<svg class="w-12 h-12 text-green-500 mx-auto mb-2" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg>'),
|
| 234 |
|
| 235 |
# Results
|
| 236 |
+
H3('Analysis Complete', cls="text-lg font-medium text-gray-700 text-center mb-2"),
|
| 237 |
|
| 238 |
# Prediction image
|
| 239 |
Div(
|
requirements.txt
CHANGED
|
@@ -1,10 +1,11 @@
|
|
| 1 |
python-fasthtml
|
| 2 |
fasthtml-hf
|
| 3 |
fastai==2.8.1
|
| 4 |
-
torch==
|
| 5 |
-
torchvision==0.
|
| 6 |
-
fastcore==1.
|
| 7 |
-
timm==0.
|
|
|
|
| 8 |
Pillow
|
| 9 |
starlette
|
| 10 |
uvicorn>=0.29
|
|
|
|
| 1 |
python-fasthtml
|
| 2 |
fasthtml-hf
|
| 3 |
fastai==2.8.1
|
| 4 |
+
torch==2.6.0
|
| 5 |
+
torchvision==0.21.0
|
| 6 |
+
fastcore==1.8.1
|
| 7 |
+
timm==1.0.9
|
| 8 |
+
open_clip_torch==2.30.0
|
| 9 |
Pillow
|
| 10 |
starlette
|
| 11 |
uvicorn>=0.29
|