Update app.py
Browse files462 unmodified lines4634644654664674684694701 unmodified line47247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652710 unmodified lines538539540541542543544545546547548549462 unmodified linesmargin: 0 auto !important;justify-content: center !important;gap: 8px !important;min-height: 150px !important;}.centered-examples .thumb {height: 100px !important;width: 100px !important;1 unmodified linemargin: 5px !important;}/* Universal solution - targets any element with both fixed-height and svelte classes */[class*="fixed-height"][class*="svelte-"] {min-height: 0 !important;max-height: 200px !important;height: auto !important;overflow-y: auto !important;}/* More specific for grid-wrap containers */[class*="grid-wrap"][class*="svelte-"][class*="fixed-height"] {min-height: 0 !important;max-height: 200px !important;height: auto !important;overflow-y: auto !important;}/* Target gallery containers specifically */#my_media_gallery [class*="grid-wrap"] {min-height: 0 !important;max-height: 200px !important;height: auto !important;overflow-y: auto !important;}/* Media query version */@media (min-width: 1280px) {[class*="fixed-height"][class*="svelte-"] {min-height: 0 !important;max-height: 200px !important;height: auto !important;}[class*="grid-wrap"][class*="svelte-"][class*="fixed-height"] {min-height: 0 !important;max-height: 200px !important;height: auto !important;}}/* Fallback with even higher specificity */div[class*="fixed-height"][class*="svelte-"]:not([style*="min-height"]) {min-height: 0 !important;}/* Target the specific gallery by ID */#my_media_gallery div[class*="grid-wrap"] {min-height: 0 !important;max-height: 200px !important;height: auto !important;overflow-y: auto !important;}"""10 unmodified linesgr.Markdown("For Faster useage please download the files and run it locally (takes 20 seconds/translation on a 4080). On cpu it takes around 10 min/tranlation!")#inputswith gr.Column(scale=1):gallery = gr.Gallery(value=example_images,label="Example Images (Click to Select)",columns=6,allow_preview=False,elem_id="my_media_gallery",elem_classes=["centered-examples"])with gr.Row(scale=2):input_img = gr.Image(label="Input Image ")detection_img = gr.Image(label="Detection Image", interactive= False)462 unmodified lines4634644654664674684694701 unmodified line47247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255310 unmodified lines564565566567568569570571572573574575576577578579580581582583462 unmodified linesmargin: 0 auto !important;justify-content: center !important;gap: 8px !important;}.centered-examples .thumb {height: 100px !important;width: 100px !important;1 unmodified linemargin: 5px !important;}/* Fix for gallery container - let it size to content */#my_media_gallery {height: auto !important;min-height: auto !important;max-height: none !important;}/* Target the gallery grid wrapper specifically */#my_media_gallery [class*="grid-wrap"],#my_media_gallery .grid-wrap {height: auto !important;min-height: auto !important;max-height: none !important;flex: none !important;display: grid !important;grid-template-columns: repeat(6, 1fr) !important;grid-auto-rows: min-content !important;gap: 8px !important;padding: 8px !important;}/* Override any fixed-height constraints */[class*="fixed-height"][class*="svelte-"] {height: auto !important;min-height: auto !important;max-height: none !important;flex: none !important;}/* Specific targeting for the gallery's parent containers */#my_media_gallery .svelte-vt1mxs,#my_media_gallery [class*="svelte-vt1mxs"] {height: auto !important;min-height: auto !important;flex: none !important;}/* Ensure gallery doesn't shrink on wide screens */@media (min-width: 1280px) {#my_media_gallery {height: auto !important;min-height: auto !important;max-height: none !important;flex: none !important;}#my_media_gallery [class*="grid-wrap"],#my_media_gallery .grid-wrap {height: auto !important;min-height: auto !important;max-height: none !important;flex: none !important;}[class*="fixed-height"][class*="svelte-"] {height: auto !important;min-height: auto !important;max-height: none !important;flex: none !important;}}/* Force grid layout for proper image arrangement */#my_media_gallery [class*="grid-wrap"] > div {display: grid !important;grid-template-columns: repeat(6, minmax(100px, 1fr)) !important;gap: 8px !important;width: 100% !important;}/* Ensure thumbnails maintain proper size */#my_media_gallery img,#my_media_gallery .thumbnail img {width: 100px !important;height: 100px !important;object-fit: cover !important;}"""10 unmodified linesgr.Markdown("For Faster useage please download the files and run it locally (takes 20 seconds/translation on a 4080). On cpu it takes around 10 min/tranlation!")#inputswith gr.Column(scale=1):gallery = gr.Gallery(value=example_images,label="Example Images (Click to Select)",columns=6,rows=None, # Let it auto-size based on contentheight="auto", # Auto height based on contentallow_preview=False,container=False, # Remove container constraintselem_id="my_media_gallery",elem_classes=["centered-examples"],interactive=True,show_label=True,object_fit="cover")with gr.Row(scale=2):input_img = gr.Image(label="Input Image ")detection_img = gr.Image(label="Detection Image", interactive= False)
app.py+72-38