add lang=en by default
Browse files
app.py
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
# AUTOGENERATED! DO NOT EDIT! File to edit: ../pokemonclassifier.ipynb.
|
2 |
|
3 |
# %% auto 0
|
4 |
-
__all__ = ['modelname', 'pokemon_types', 'pokemon_types_en', 'learn_inf', 'imagespath', 'lang', '
|
5 |
-
'classify_image']
|
6 |
|
7 |
# %% ../pokemonclassifier.ipynb 3
|
8 |
import pandas as pd
|
@@ -21,21 +21,22 @@ imagespath = ''
|
|
21 |
|
22 |
# %% ../pokemonclassifier.ipynb 31
|
23 |
import gradio as gr
|
24 |
-
from flask import request
|
25 |
|
26 |
lang = 'en'
|
|
|
|
|
|
|
|
|
27 |
prob_threshold = 0.75
|
28 |
-
|
|
|
29 |
if request:
|
30 |
lang = request.headers.get("Accept-Language")
|
|
|
31 |
if lang == 'fr':
|
32 |
title = "# PokeFace : Quel est ce pokemon ?"
|
33 |
description = "## Un classifieur d'images pour les pokemons de 1ere génération (001-151)"
|
34 |
unknown = 'inconnu'
|
35 |
-
else:
|
36 |
-
title = "# PokeFace : What is this pokemon ?"
|
37 |
-
description = "## An image classifier for 1st generation pokemons (001-151)"
|
38 |
-
unknown = 'unknown'
|
39 |
|
40 |
def classify_image(img):
|
41 |
pred,pred_idx,probs = learn_inf.predict(img)
|
|
|
1 |
# AUTOGENERATED! DO NOT EDIT! File to edit: ../pokemonclassifier.ipynb.
|
2 |
|
3 |
# %% auto 0
|
4 |
+
__all__ = ['modelname', 'pokemon_types', 'pokemon_types_en', 'learn_inf', 'imagespath', 'lang', 'title', 'description', 'unknown',
|
5 |
+
'prob_threshold', 'classify_image']
|
6 |
|
7 |
# %% ../pokemonclassifier.ipynb 3
|
8 |
import pandas as pd
|
|
|
21 |
|
22 |
# %% ../pokemonclassifier.ipynb 31
|
23 |
import gradio as gr
|
|
|
24 |
|
25 |
lang = 'en'
|
26 |
+
title = "# PokeFace : What is this pokemon ?"
|
27 |
+
description = "## An image classifier for 1st generation pokemons (001-151)"
|
28 |
+
unknown = 'unknown'
|
29 |
+
|
30 |
prob_threshold = 0.75
|
31 |
+
|
32 |
+
from flask import request
|
33 |
if request:
|
34 |
lang = request.headers.get("Accept-Language")
|
35 |
+
print(lang)
|
36 |
if lang == 'fr':
|
37 |
title = "# PokeFace : Quel est ce pokemon ?"
|
38 |
description = "## Un classifieur d'images pour les pokemons de 1ere génération (001-151)"
|
39 |
unknown = 'inconnu'
|
|
|
|
|
|
|
|
|
40 |
|
41 |
def classify_image(img):
|
42 |
pred,pred_idx,probs = learn_inf.predict(img)
|