Update app.py
Browse files
app.py
CHANGED
|
@@ -143,12 +143,20 @@ def process_landmark(landmark):
|
|
| 143 |
txt = fetch_wikipedia_summary(landmark)
|
| 144 |
if txt == "Found error!":
|
| 145 |
return None
|
| 146 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 147 |
tr = translator(sm, max_length=1000)[0]["translation_text"]
|
|
|
|
|
|
|
| 148 |
return text_to_speech(tr)
|
| 149 |
|
| 150 |
def process_image_clip(image):
|
| 151 |
recognized, score = recognize_landmark_clip(image)
|
|
|
|
|
|
|
| 152 |
return process_landmark(recognized)
|
| 153 |
|
| 154 |
def process_text_clip(landmark):
|
|
|
|
| 143 |
txt = fetch_wikipedia_summary(landmark)
|
| 144 |
if txt == "Found error!":
|
| 145 |
return None
|
| 146 |
+
print('Wiki text: ')
|
| 147 |
+
print(txt)
|
| 148 |
+
sm = summarizer(txt, min_length=20, max_length=210)[0]["summary_text
|
| 149 |
+
print('Summarized text: ')
|
| 150 |
+
print(sm)
|
| 151 |
tr = translator(sm, max_length=1000)[0]["translation_text"]
|
| 152 |
+
print('Translated text: ')
|
| 153 |
+
print(sm)
|
| 154 |
return text_to_speech(tr)
|
| 155 |
|
| 156 |
def process_image_clip(image):
|
| 157 |
recognized, score = recognize_landmark_clip(image)
|
| 158 |
+
print('Recognized: ')
|
| 159 |
+
print(recognized)
|
| 160 |
return process_landmark(recognized)
|
| 161 |
|
| 162 |
def process_text_clip(landmark):
|