# Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the Apache License, Version 2.0 # found in the LICENSE file in the root directory of this source tree. """ CSS and HTML content for the MapAnything Gradio application. This module contains all the CSS styles and HTML content blocks used in the Gradio interface. """ # CSS Styles for the Gradio interface GRADIO_CSS = """ .custom-log * { font-style: italic; font-size: 22px !important; background-image: linear-gradient(120deg, #ffb366 0%, #ffa366 60%, #ff9966 100%); -webkit-background-clip: text; background-clip: text; font-weight: bold !important; color: transparent !important; text-align: center !important; } .example-log * { font-style: italic; font-size: 16px !important; background-image: linear-gradient(120deg, #ffb366 0%, #ffa366 60%, #ff9966 100%); -webkit-background-clip: text; background-clip: text; color: transparent !important; } #my_radio .wrap { display: flex; flex-wrap: nowrap; justify-content: center; align-items: center; } #my_radio .wrap label { display: flex; width: 50%; justify-content: center; align-items: center; margin: 0; padding: 10px 0; box-sizing: border-box; } /* Align navigation buttons with dropdown bottom */ .navigation-row { display: flex !important; align-items: flex-end !important; gap: 8px !important; } .navigation-row > div:nth-child(1), .navigation-row > div:nth-child(3) { align-self: flex-end !important; } .navigation-row > div:nth-child(2) { flex: 1 !important; } /* Make thumbnails clickable with pointer cursor */ .clickable-thumbnail img { cursor: pointer !important; } .clickable-thumbnail:hover img { cursor: pointer !important; opacity: 0.8; transition: opacity 0.3s ease; } /* Make thumbnail containers narrower horizontally */ .clickable-thumbnail { padding: 5px 2px !important; margin: 0 2px !important; } .clickable-thumbnail .image-container { margin: 0 !important; padding: 0 !important; } .scene-info { text-align: center !important; padding: 5px 2px !important; margin: 0 !important; } """ def get_header_html(logo_base64=None): """ Generate the main header HTML with logo and title. Args: logo_base64 (str, optional): Base64 encoded logo image Returns: str: HTML string for the header """ logo_style = "display: none;" if not logo_base64 else "" logo_src = logo_base64 or "" return f"""
🌟 GitHub Repository | 🚀 Project Page
""" def get_description_html(): """ Generate the main description and getting started HTML. Returns: str: HTML string for the description """ return """Upload a video or a set of images to create a 3D reconstruction of a scene or object. MapAnything takes these images and generates 3D point clouds directly from multi-view images.
This demo demonstrates the use of image inputs only. However, MapAnything is extremely flexible and supports any combination of inputs (images, calibration, poses & depth). For trying out memory efficient inference or additional inputs like cameras & depth, please check out the code in our Github repo.
Please note: The inference time changes based on the amount of input images, for e.g., less than 1 second for up to 50 views. However, downloading model weights and visualizing 3D points may take tens of seconds. Please be patient or, for faster visualization, use a local machine to run our demo from our GitHub repository.
This site builds upon code from:
We extend our gratitude to these projects for their valuable contributions to the research community.