fixing cat and dog
Browse files- .DS_Store +0 -0
- .idea/inspectionProfiles/profiles_settings.xml +6 -0
- .idea/minima.iml +8 -0
- .idea/misc.xml +4 -0
- .idea/modules.xml +8 -0
- .idea/vcs.xml +6 -0
- .idea/workspace.xml +2 -4
- cat.jpeg +0 -0
- dunno.jpeg +0 -0
- minima/app.py +28 -0
.DS_Store
ADDED
Binary file (6.15 kB). View file
|
|
.idea/inspectionProfiles/profiles_settings.xml
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<component name="InspectionProjectProfileManager">
|
2 |
+
<settings>
|
3 |
+
<option name="USE_PROJECT_PROFILE" value="false" />
|
4 |
+
<version value="1.0" />
|
5 |
+
</settings>
|
6 |
+
</component>
|
.idea/minima.iml
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<module type="PYTHON_MODULE" version="4">
|
3 |
+
<component name="NewModuleRootManager">
|
4 |
+
<content url="file://$MODULE_DIR$" />
|
5 |
+
<orderEntry type="jdk" jdkName="Python 3.8 (fastai)" jdkType="Python SDK" />
|
6 |
+
<orderEntry type="sourceFolder" forTests="false" />
|
7 |
+
</component>
|
8 |
+
</module>
|
.idea/misc.xml
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<project version="4">
|
3 |
+
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.8 (fastai)" project-jdk-type="Python SDK" />
|
4 |
+
</project>
|
.idea/modules.xml
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<project version="4">
|
3 |
+
<component name="ProjectModuleManager">
|
4 |
+
<modules>
|
5 |
+
<module fileurl="file://$PROJECT_DIR$/.idea/minima.iml" filepath="$PROJECT_DIR$/.idea/minima.iml" />
|
6 |
+
</modules>
|
7 |
+
</component>
|
8 |
+
</project>
|
.idea/vcs.xml
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<project version="4">
|
3 |
+
<component name="VcsDirectoryMappings">
|
4 |
+
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
5 |
+
</component>
|
6 |
+
</project>
|
.idea/workspace.xml
CHANGED
@@ -1,9 +1,7 @@
|
|
1 |
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
<project version="4">
|
3 |
<component name="ChangeListManager">
|
4 |
-
<list default="true" id="0aa75955-895e-4348-b0b0-c11274571539" name="Changes" comment=""
|
5 |
-
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
6 |
-
</list>
|
7 |
<option name="SHOW_DIALOG" value="false" />
|
8 |
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
9 |
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
@@ -51,7 +49,7 @@
|
|
51 |
<option name="presentableId" value="Default" />
|
52 |
<updated>1668568291645</updated>
|
53 |
<workItem from="1668568294575" duration="6341000" />
|
54 |
-
<workItem from="1668575117478" duration="
|
55 |
</task>
|
56 |
<servers />
|
57 |
</component>
|
|
|
1 |
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
<project version="4">
|
3 |
<component name="ChangeListManager">
|
4 |
+
<list default="true" id="0aa75955-895e-4348-b0b0-c11274571539" name="Changes" comment="" />
|
|
|
|
|
5 |
<option name="SHOW_DIALOG" value="false" />
|
6 |
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
7 |
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
|
|
49 |
<option name="presentableId" value="Default" />
|
50 |
<updated>1668568291645</updated>
|
51 |
<workItem from="1668568294575" duration="6341000" />
|
52 |
+
<workItem from="1668575117478" duration="1780000" />
|
53 |
</task>
|
54 |
<servers />
|
55 |
</component>
|
cat.jpeg
CHANGED
dunno.jpeg
CHANGED
minima/app.py
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# AUTOGENERATED! DO NOT EDIT! File to edit: ../app.ipynb.
|
2 |
+
|
3 |
+
# %% auto 0
|
4 |
+
__all__ = ['learn', 'categories', 'image', 'label', 'examples', 'intf', 'is_cat', 'classify_image']
|
5 |
+
|
6 |
+
# %% ../app.ipynb 1
|
7 |
+
from fastai.vision.all import *
|
8 |
+
import gradio as gr
|
9 |
+
|
10 |
+
def is_cat(x): return x[0].isupper()
|
11 |
+
|
12 |
+
# %% ../app.ipynb 3
|
13 |
+
learn = load_learner('model.pkl')
|
14 |
+
|
15 |
+
# %% ../app.ipynb 5
|
16 |
+
categories =('Dog','Cat')
|
17 |
+
|
18 |
+
def classify_image(img):
|
19 |
+
pred,idx,probs=learn.predict(img)
|
20 |
+
return dict(zip(categories,map(float,probs)))
|
21 |
+
|
22 |
+
# %% ../app.ipynb 7
|
23 |
+
image = gr.inputs.Image(shape=(192,192))
|
24 |
+
label=gr.outputs.Label()
|
25 |
+
examples = ['dog.jpeg','cat.jpeg','dunno.jpeg']
|
26 |
+
|
27 |
+
intf =gr.Interface(fn=classify_image, inputs=image,outputs=label,examples=examples)
|
28 |
+
intf.launch(inline=False)
|