Upload app.py
Browse files
app.py
CHANGED
@@ -561,15 +561,9 @@ def update_translations(image, edited_texts, translations_list, img_removed_text
|
|
561 |
final_result = position_text_back(new_text, box, final_result, font_path=f"fonts/{font}.ttf", font_color=font_rgba)
|
562 |
|
563 |
return np.array(final_result)
|
|
|
564 |
|
565 |
-
|
566 |
-
|
567 |
-
with gr.Blocks(title="Nativ - Demo", examples=[
|
568 |
-
["assets/chinese.png", "Simplified Chinese", "English", "Basic", "omniscript_bold", "#000000"],
|
569 |
-
["assets/chinese.png", "Simplified Chinese", "English", "Advanced", "Ldfcomicsansbold", "#d31515"],
|
570 |
-
["assets/korean.png", "Korean", "Spanish", "Basic", "omniscript_bold", "#000000"],
|
571 |
-
["assets/chinese.png", "English", "French", "Basic", "omniscript_bold", "#000000"],
|
572 |
-
]) as demo:
|
573 |
# Store translations list in state
|
574 |
translations_state = gr.State([])
|
575 |
|
@@ -655,5 +649,16 @@ with gr.Blocks(title="Nativ - Demo", examples=[
|
|
655 |
outputs=final_output
|
656 |
)
|
657 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
658 |
|
659 |
demo.launch(debug=False, show_error=True,share=True)
|
|
|
561 |
final_result = position_text_back(new_text, box, final_result, font_path=f"fonts/{font}.ttf", font_color=font_rgba)
|
562 |
|
563 |
return np.array(final_result)
|
564 |
+
|
565 |
|
566 |
+
with gr.Blocks(title="Nativ - Demo") as demo:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
567 |
# Store translations list in state
|
568 |
translations_state = gr.State([])
|
569 |
|
|
|
649 |
outputs=final_output
|
650 |
)
|
651 |
|
652 |
+
# Add examples here
|
653 |
+
gr.Examples(
|
654 |
+
examples=[
|
655 |
+
["assets/chinese.png", "Simplified Chinese", "English", "Basic", "omniscript_bold", "#000000"],
|
656 |
+
["assets/chinese.png", "Simplified Chinese", "English", "Advanced", "Ldfcomicsansbold", "#d31515"],
|
657 |
+
["assets/korean.png", "Korean", "Spanish", "Basic", "omniscript_bold", "#000000"],
|
658 |
+
["assets/chinese.png", "English", "French", "Basic", "omniscript_bold", "#000000"],
|
659 |
+
],
|
660 |
+
inputs=[input_image, source_language, target_language, localization_mode, font_selector_i, font_color_picker_i]
|
661 |
+
)
|
662 |
+
|
663 |
|
664 |
demo.launch(debug=False, show_error=True,share=True)
|