Commit
路
a89682b
1
Parent(s):
918ac14
Update app.py
Browse files
app.py
CHANGED
@@ -19,7 +19,8 @@ from fastai.vision.all import *
|
|
19 |
# temp = pathlib.PosixPath
|
20 |
# pathlib.PosixPath = pathlib.WindowsPath
|
21 |
|
22 |
-
|
|
|
23 |
|
24 |
st.set_page_config(page_title="Aplicaci贸n cancer de mama - IXCHEN")
|
25 |
|
@@ -31,9 +32,9 @@ class Modelo:
|
|
31 |
|
32 |
def cargar_modelo(self, modelo):
|
33 |
if modelo == "alexnet":
|
34 |
-
return load_learner('clasificacion_alexnet.pkl')
|
35 |
elif modelo == 'restnet50':
|
36 |
-
return load_learner('clasificacion.pkl')
|
37 |
|
38 |
def predecir(self, imagen):
|
39 |
_, _, probs = self.modelo.predict(imagen)
|
|
|
19 |
# temp = pathlib.PosixPath
|
20 |
# pathlib.PosixPath = pathlib.WindowsPath
|
21 |
|
22 |
+
# Get the directory of the current script
|
23 |
+
script_dir = os.path.dirname(os.path.realpath(__file__))
|
24 |
|
25 |
st.set_page_config(page_title="Aplicaci贸n cancer de mama - IXCHEN")
|
26 |
|
|
|
32 |
|
33 |
def cargar_modelo(self, modelo):
|
34 |
if modelo == "alexnet":
|
35 |
+
return load_learner(os.path.join(script_dir, 'clasificacion_alexnet.pkl'))
|
36 |
elif modelo == 'restnet50':
|
37 |
+
return load_learner(os.path.join(script_dir, 'clasificacion.pkl'))
|
38 |
|
39 |
def predecir(self, imagen):
|
40 |
_, _, probs = self.modelo.predict(imagen)
|