Spaces:
Sleeping
Sleeping
Upload app.py with huggingface_hub
Browse files
app.py
CHANGED
@@ -14,25 +14,37 @@ class ADA_DOGS(object):
|
|
14 |
# initialize the object
|
15 |
def __init__(self, name="Wallaby",verbose=True,*args, **kwargs):
|
16 |
super(ADA_DOGS, self).__init__(*args, **kwargs)
|
|
|
|
|
17 |
if (verbose):
|
18 |
-
self.author = "Duc Haba"
|
19 |
-
self.name = name
|
20 |
self._ph()
|
21 |
self._pp("Hello from class", str(self.__class__) + " Class: " + str(self.__class__.__name__))
|
22 |
self._pp("Code name", self.name)
|
23 |
self._pp("Author is", self.author)
|
24 |
self._ph()
|
25 |
#
|
26 |
-
self.article = '<div><h3>
|
27 |
-
self.article += 'Author: Duc Haba, 2022.</li>'
|
28 |
self.article += '<li>https://linkedin.com/in/duchaba</li>'
|
29 |
self.article += '<li>The training dataset is from the Data Scientist at Department of Health '
|
30 |
self.article += 'and Social Care London, England, United Kingdom.</li>'
|
31 |
self.article += '<li>https://www.kaggle.com/datasets/amandam1/120-dog-breeds-breed-classification</li>'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
self.article += '</ul></div>'
|
33 |
self.examples = ['dog1.jpg','dog2.jpg','dog3.jpg','dog4.jpg','dog5.png','dog6.jpg', 'dog7.jpg','duc.jpg']
|
|
|
34 |
return
|
35 |
-
#
|
36 |
# pretty print output name-value line
|
37 |
def _pp(self, a, b):
|
38 |
print("%34s : %s" % (str(a), str(b)))
|
@@ -93,7 +105,7 @@ intf = gradio.Interface(fn=maxi.predict_donut,
|
|
93 |
inputs=hf_image,
|
94 |
outputs=["plot"],
|
95 |
examples=maxi.examples,
|
96 |
-
title=
|
97 |
live=True,
|
98 |
article=maxi.article)
|
99 |
intf.launch(inline=False,share=True)
|
|
|
14 |
# initialize the object
|
15 |
def __init__(self, name="Wallaby",verbose=True,*args, **kwargs):
|
16 |
super(ADA_DOGS, self).__init__(*args, **kwargs)
|
17 |
+
self.author = "Duc Haba"
|
18 |
+
self.name = name
|
19 |
if (verbose):
|
|
|
|
|
20 |
self._ph()
|
21 |
self._pp("Hello from class", str(self.__class__) + " Class: " + str(self.__class__.__name__))
|
22 |
self._pp("Code name", self.name)
|
23 |
self._pp("Author is", self.author)
|
24 |
self._ph()
|
25 |
#
|
26 |
+
self.article = '<div><h3>Citation:</h3><ul><li>'
|
27 |
+
self.article += 'Author/Dev: Duc Haba, 2022.</li>'
|
28 |
self.article += '<li>https://linkedin.com/in/duchaba</li>'
|
29 |
self.article += '<li>The training dataset is from the Data Scientist at Department of Health '
|
30 |
self.article += 'and Social Care London, England, United Kingdom.</li>'
|
31 |
self.article += '<li>https://www.kaggle.com/datasets/amandam1/120-dog-breeds-breed-classification</li>'
|
32 |
+
self.article += '</ul>'
|
33 |
+
self.article += '<h3>Train Result:</h3><ul>'
|
34 |
+
self.article += '<li>F1-Score, Precision, and Recall -- Take the output from method sklearn.metrics.classification_report(), import to Pandas Data Fame, sorted, and graph it.</li>'
|
35 |
+
self.article += '<li><img src="file/ada_f1.png" alt="F1-Score, Precision, and Recall Graph" width="640"</li>'
|
36 |
+
self.article += '</ul>'
|
37 |
+
self.article += '<h3>Dev Stack:</h3><ul>'
|
38 |
+
self.article += '<li>Jupyter Notebook, Python, Pandas, Matplotlib, Sklearn</li>'
|
39 |
+
self.article += '<li>Fast.ai, PyTorch</li>'
|
40 |
+
self.article += '</ul>'
|
41 |
+
self.article += '<h3>Licenses:</h3><ul>'
|
42 |
+
self.article += '<li>GNU GPL 3.0, https://www.gnu.org/licenses/gpl-3.0.txt</li>'
|
43 |
self.article += '</ul></div>'
|
44 |
self.examples = ['dog1.jpg','dog2.jpg','dog3.jpg','dog4.jpg','dog5.png','dog6.jpg', 'dog7.jpg','duc.jpg']
|
45 |
+
self.title = "120 Dog Breeds Prediction"
|
46 |
return
|
47 |
+
#
|
48 |
# pretty print output name-value line
|
49 |
def _pp(self, a, b):
|
50 |
print("%34s : %s" % (str(a), str(b)))
|
|
|
105 |
inputs=hf_image,
|
106 |
outputs=["plot"],
|
107 |
examples=maxi.examples,
|
108 |
+
title=maxi.title,
|
109 |
live=True,
|
110 |
article=maxi.article)
|
111 |
intf.launch(inline=False,share=True)
|