Vinay Jose commited on
Commit
55db4a2
1 Parent(s): db56a7d

initial commit

Browse files
Files changed (7) hide show
  1. app.py +16 -0
  2. chandler.jpg +0 -0
  3. joey.jpg +0 -0
  4. model.pkl +3 -0
  5. monica.jpg +0 -0
  6. phoebe.jpg +0 -0
  7. requirements.txt +97 -0
app.py ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from fastai.vision.all import *
2
+ import gradio as gr
3
+
4
+ learn = load_learner("model.pkl")
5
+ labels = learn.dls.vocab
6
+
7
+ def predict(img):
8
+ img = PILImage.create(img)
9
+ _,_,probs = learn.predict(img)
10
+ return dict(zip(labels, map(float, probs)))
11
+
12
+ examples = [PILImage.create(img) for img in ["phoebe.jpg", "chandler.jpg", "joey.jpg", "monica.jpg"]]
13
+ title = "Which Disney character are you?"
14
+ description = "A disney character image classification app created as part fast.ai DL course - Part 1."
15
+ intf = gr.Interface(fn=predict, inputs="image", outputs="label", title=title, description=description, examples=examples)
16
+ intf.launch(inline=False)
chandler.jpg ADDED
joey.jpg ADDED
model.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e8149302e747c9051228d76a7a3e37332a344fd332aa4707414956ae56f3545f
3
+ size 201350542
monica.jpg ADDED
phoebe.jpg ADDED
requirements.txt ADDED
@@ -0,0 +1,97 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ aiofiles==23.2.1
2
+ altair==5.2.0
3
+ annotated-types==0.6.0
4
+ anyio==4.2.0
5
+ attrs==23.2.0
6
+ blis==0.7.11
7
+ catalogue==2.0.10
8
+ certifi==2024.2.2
9
+ charset-normalizer==3.3.2
10
+ click==8.1.7
11
+ cloudpathlib==0.16.0
12
+ colorama==0.4.6
13
+ confection==0.1.4
14
+ contourpy==1.2.0
15
+ cycler==0.12.1
16
+ cymem==2.0.8
17
+ exceptiongroup==1.2.0
18
+ fastai==2.7.14
19
+ fastapi==0.109.2
20
+ fastcore==1.5.29
21
+ fastdownload==0.0.7
22
+ fastprogress==1.0.3
23
+ ffmpy==0.3.2
24
+ filelock==3.13.1
25
+ fonttools==4.48.1
26
+ fsspec==2024.2.0
27
+ gradio==4.18.0
28
+ gradio_client==0.10.0
29
+ h11==0.14.0
30
+ httpcore==1.0.2
31
+ httpx==0.26.0
32
+ huggingface-hub==0.20.3
33
+ idna==3.6
34
+ importlib-resources==6.1.1
35
+ Jinja2==3.1.3
36
+ joblib==1.3.2
37
+ jsonschema==4.21.1
38
+ jsonschema-specifications==2023.12.1
39
+ kiwisolver==1.4.5
40
+ langcodes==3.3.0
41
+ markdown-it-py==3.0.0
42
+ MarkupSafe==2.1.5
43
+ matplotlib==3.8.2
44
+ mdurl==0.1.2
45
+ mpmath==1.3.0
46
+ murmurhash==1.0.10
47
+ networkx==3.2.1
48
+ numpy==1.26.4
49
+ orjson==3.9.14
50
+ packaging==23.2
51
+ pandas==2.2.0
52
+ pillow==10.2.0
53
+ preshed==3.0.9
54
+ pydantic==2.6.1
55
+ pydantic_core==2.16.2
56
+ pydub==0.25.1
57
+ Pygments==2.17.2
58
+ pyparsing==3.1.1
59
+ python-dateutil==2.8.2
60
+ python-multipart==0.0.9
61
+ pytz==2024.1
62
+ PyYAML==6.0.1
63
+ referencing==0.33.0
64
+ requests==2.31.0
65
+ rich==13.7.0
66
+ rpds-py==0.18.0
67
+ ruff==0.2.1
68
+ safetensors==0.4.2
69
+ scikit-learn==1.4.0
70
+ scipy==1.12.0
71
+ semantic-version==2.10.0
72
+ shellingham==1.5.4
73
+ six==1.16.0
74
+ smart-open==6.4.0
75
+ sniffio==1.3.0
76
+ spacy==3.7.2
77
+ spacy-legacy==3.0.12
78
+ spacy-loggers==1.0.5
79
+ srsly==2.4.8
80
+ starlette==0.36.3
81
+ sympy==1.12
82
+ thinc==8.2.3
83
+ threadpoolctl==3.2.0
84
+ timm==0.9.12
85
+ tomlkit==0.12.0
86
+ toolz==0.12.1
87
+ torch==2.2.0
88
+ torchvision==0.17.0
89
+ tqdm==4.66.2
90
+ typer==0.9.0
91
+ typing_extensions==4.9.0
92
+ tzdata==2024.1
93
+ urllib3==2.2.0
94
+ uvicorn==0.27.1
95
+ wasabi==1.1.2
96
+ weasel==0.3.4
97
+ websockets==11.0.3