|
Download README.md from zhangwenjia/MobileViews: direct link, hf CLI and curl.
- Browser
- Download file 17.9 kB
-
https://huggingface.co/datasets/zhangwenjia/MobileViews/resolve/main/README.md
- Command line
-
hf download hf://datasets/zhangwenjia/MobileViews/README.md
-
curl -L -o README.md https://huggingface.co/datasets/zhangwenjia/MobileViews/resolve/main/README.md
17.9 kB
| language: [en] | |
| license: mit | |
| datasets: [MobileViews] | |
| pretty_name: "MobileViews: A Large-Scale Mobile GUI Dataset" | |
| tags: | |
| - mobile-ui | |
| - user-interfaces | |
| - view-hierarchy | |
| - android-apps | |
| - screenshots | |
| task_categories: | |
| - question-answering | |
| - image-to-text | |
| task_ids: | |
| - task-planning | |
| - visual-question-answering | |
| # 🚀 MobileViews: A Large-Scale Mobile GUI Dataset | |
| **MobileViews** is a large-scale dataset designed to support research on mobile agents and mobile user interface (UI) analysis. The first release, **MobileViews-600K**, includes over **600,000** mobile UI screenshot-view hierarchy (VH) pairs collected from over **20,000 apps** on the Google Play Store. This dataset is based on the [DroidBot](https://honeynet.github.io/droidbot/), which we have optimized for large-scale data collection, capturing more comprehensive interaction details while maintaining consistency with DroidBot’s output structure. | |
| [**📖 Read the Paper**](https://arxiv.org/abs/2409.14337) — If you’d like to dive deeper into the details of how we construct this dataset, or explore the training experiments we conduct using `MobileViews`, we encourage you to check out our paper. The paper, along with this dataset, contains everything you need to understand our process and replicate or build upon our findings! | |
| ## 🤗 Table of Contents | |
| - [🚀 MobileViews: A Large-Scale Mobile GUI Dataset](#-mobileviews-a-large-scale-mobile-gui-dataset) | |
| - [🤗 Table of Contents](#-table-of-contents) | |
| - [🥳 NEWS](#-news) | |
| - [🧐 Dataset Overview](#-dataset-overview) | |
| - [Folder Structure](#folder-structure) | |
| - [1. MobileViews\_Screenshots\_ViewHierarchies](#1-mobileviews_screenshots_viewhierarchies) | |
| - [Screenshot-VH File Descriptions](#screenshot-vh-file-descriptions) | |
| - [2. MobileViews\_Apps\_CompleteTraces](#2-mobileviews_apps_completetraces) | |
| - [App Trace Folder Structure](#app-trace-folder-structure) | |
| - [🔎 Detailed Metadata and File Descriptions](#-detailed-metadata-and-file-descriptions) | |
| - [AppMetadata.csv Columns](#appmetadatacsv-columns) | |
| - [Index and Parquet files for `MobileViews_Screenshots_ViewHierarchies`](#index-and-parquet-files-for-mobileviews_screenshots_viewhierarchies) | |
| - [Index files for `MobileViews_Apps_CompeleteTraces`](#index-files-for-mobileviews_apps_compeletetraces) | |
| - [🌏 How to Download](#-how-to-download) | |
| - [Download via Hugging Face Python Library or CLI](#download-via-hugging-face-python-library-or-cli) | |
| - [**Option 1: Download via Python Script**](#option-1-download-via-python-script) | |
| - [**Option 2: Download via Hugging Face CLI**](#option-2-download-via-hugging-face-cli) | |
| - [References](#references) | |
| - [📋 Usage Guidelines](#-usage-guidelines) | |
| - [Using `zip` and `parquet` Files in `MobileViews_Screenshots_ViewHierarchies`](#using-zip-and-parquet-files-in-mobileviews_screenshots_viewhierarchies) | |
| - [Mapping Screenshots and States in `MobileViews_Apps_CompleteTraces`](#mapping-screenshots-and-states-in-mobileviews_apps_completetraces) | |
| - [🌟 Future Updates and Feedback](#-future-updates-and-feedback) | |
| - [🔖 Citation](#-citation) | |
| ## 🥳 NEWS | |
| - **`2024/11`** – **New Release!** We’ve expanded the dataset to include comprehensive interaction data, now featuring traces and action sequences for `20,000+` apps. | |
| - **`2024/10`** – **Initial Launch!** The `MobileViews` dataset is live with `600,000+` unique screenshot-VH pairs, deduplicated across `20,000+` Android apps. | |
| ## 🧐 Dataset Overview | |
| ### Folder Structure | |
| The dataset is organized into two main folders: | |
| 1. **MobileViews_Screenshots_ViewHierarchies**: Contains the core screenshot-VH pairs in both `.zip` and `.parquet` formats. All pairs are globally deduplicated based on their image hash values, ensuring unique UI states across the dataset. | |
| 2. **MobileViews_Apps_CompleteTraces**: Provides complete interaction traces for individual apps, including states, actions, and transitions. | |
| ### 1. MobileViews_Screenshots_ViewHierarchies | |
| This folder contains 600K screenshot-VH pairs, formatted in both `.zip` and `.parquet` formats. Each `.zip` and `.parquet` file pair, along with their respective CSV index files, follows a consistent data structure for easy access. | |
| - **`Parquets/`**: `.parquet` files with binary data for screenshots and JSON content for VHs. | |
| - **`Zip_Files/`**: `.zip` files with individual `.jpg` screenshots and `.json` VH files. | |
| - **`Index_CSV/`**: `csv` files, like `MobileViews_index_0-150000.csv`, that map screenshot IDs to their corresponding VH files. | |
| #### Screenshot-VH File Descriptions | |
| - **`MobileViews_0-150000.zip`**, **`MobileViews_0-150000.parquet`** and **`MobileViews_index_0-150000.csv`**: This set, containing IDs from 0 to 150,000. | |
| - **`MobileViews_150001-291197.zip`**, **`MobileViews_150001-291197.parquet`** and **`MobileViews_index_150001-291197.csv`**: This set, containing IDs from 150,001 to 291,197. | |
| - **`MobileViews_300000-400000.zip`**, **`MobileViews_300000-400000.parquet`** and **`MobileViews_index_300000-400000.csv`**: This set, containing IDs from 300,000 to 400,000. | |
| - **`MobileViews_400001-522301.zip`**, **`MobileViews_400001-522301.parquet`** and **`MobileViews_index_400001-522301.csv`**: This set, containing IDs from 400,001 to 522,301. | |
| ### 2. MobileViews_Apps_CompleteTraces | |
| The `MobileViews_Apps_CompleteTraces` folder is a new addition, providing complete interaction traces for apps. Each app trace includes screenshots, VH files, and actions taken within the app, organized as follows: | |
| - **`Zip_Files/`**: Each `.zip` file represents a batch of app data, named with an index and total screenshot count (e.g., `001_8348.zip` : the first batch with 8,348 screenshots). | |
| - Inside each zip file are **200 subfolders**, each named by an app’s package name and containing interaction data for that app. Details on each app’s interaction data structure are provided below. | |
| - **`OneExample.zip`**: A sample app trace illustrating the folder structure and contents for a single app. This zip file includes all files and subfolders needed to explore the sample app trace offline. After downloading and extracting `OneExample.zip`, you can open `index.html` in a web browser to interactively view the app trace structure, metadata, and interactions. | |
| - **`Index_CSV.zip`**: This zip file contains all the `.csv` files listing the app package names and screenshot counts for each corresponding zip file (e.g., `001_8348.csv` for `001_8348.zip`). | |
| #### App Trace Folder Structure | |
| Each app’s folder within a zip file includes: | |
| - **`states/`**: | |
| - **Screenshots**: `.jpg` files for each interaction state (e.g., `screen_1.jpg`). | |
| - **View Hierarchies**: `.json` and `.xml` files for each screenshot's UI structure (e.g., `state_1.json` and `window_dump_1.xml`). The `.json` format, captured by DroidBot’s internal logic via Android Accessibility Service, and the `.xml` format, captured via ADB commands, are nearly identical but differ in specific attributes. | |
| - **`views/`**: UI elements related to interactions, such as clicked or scrolled elements for each state transition. | |
| - **`actions.csv`**: A log of interactions within the app, with each action recorded in three columns: | |
| - `from_state`: The state before the action. | |
| - `to_state`: The state after the action. | |
| - `action`: The specific interaction, such as an `intent` command or `touch` on a UI element (e.g., `<button>`, `<p>`), often with details like the element's `alt` text and bounding box coordinates. | |
| - **`index.html`**: Open in a browser for an interactive visualization of app traces. Click nodes or edges to view metadata and interaction details for each UI state and transition. | |
| - **`utg.js`**: Supports `index.html` with structured app trace data, including UI states, transitions, and app metadata. | |
| - **`stylesheets/`**: CSS and JavaScript files for `index.html` rendering. | |
| ## 🔎 Detailed Metadata and File Descriptions | |
| ### AppMetadata.csv Columns | |
| The `AppMetadata.csv` file contains detailed information about each app. Columns include: | |
| | Column | Description | Column | Description | | |
| |---------------------|--------------------------------------|---------------------|--------------------------------------| | |
| | `title` | App title | `installs` | Number of installs | | |
| | `minInstalls` | Minimum number of installs | `realInstalls` | Real number of installs | | |
| | `score` | App score (rating) | `ratings` | Number of ratings | | |
| | `reviews` | Number of reviews | `histogram` | Rating distribution | | |
| | `price` | App price | `free` | Whether the app is free (True/False) | | |
| | `offersIAP` | Offers in-app purchases (True/False)| `inAppProductPrice` | In-app product price | | |
| | `developer` | Developer name | `developerId` | Developer ID | | |
| | `genre` | App genre | `genreId` | Genre ID | | |
| | `categories` | App categories | `contentRating` | Content rating (e.g., Everyone, Teen)| | |
| | `adSupported` | App is ad-supported (True/False) | `containsAds` | App contains ads (True/False) | | |
| | `released` | App release date | `lastUpdatedOn` | Date of latest update | | |
| | `appId` | Unique app identifier | | | | |
| ### Index and Parquet files for `MobileViews_Screenshots_ViewHierarchies` | |
| 1. Index CSV: Located in `MobileViews_Screenshots_ViewHierarchies/Index_CSV`, mapping screenshot IDs to their VH files. | |
| | Column | Description | | |
| |--------------|-------------------------------------------| | |
| | `Image File` | Filename of the screenshot (e.g., 0.jpg) | | |
| | `JSON File` | Filename of the VH (e.g., 0.json) | | |
| **Example:** | |
| ```csv | |
| Image File,JSON File | |
| 300000.jpg,300000.json | |
| 300001.jpg,300001.json | |
| ``` | |
| 2. **Parquet Columns** | |
| | Column | Description | | |
| |-----------------|--------------------------------------------------------------------------| | |
| | `image_content` | Binary data representing the image file (e.g., screenshot in `.jpg` format) | | |
| | `json_content` | JSON content representing the VH for the corresponding image | | |
| **Example Data in Parquet:** | |
| | image_content | json_content | | |
| |------------------------|----------------------------------------------------------------------| | |
| | Binary image data | `{"viewHierarchy": {"bounds": [0, 0, 1080, 1920], "viewClass": ...}` | | |
| | Binary image data | `{"viewHierarchy": {"bounds": [0, 0, 1080, 1920], "viewClass": ...}` | | |
| | Binary image data | `{"viewHierarchy": {"bounds": [0, 0, 1080, 1920], "viewClass": ...}` | | |
| ### Index files for `MobileViews_Apps_CompeleteTraces` | |
| Each index CSV in `MobileViews_Apps_CompleteTraces/Index_CSV.zip` lists the app package names and screenshot count in the corresponding zip file. | |
| | apk_name | state_number | | |
| |-----------------------------|--------------| | |
| | com.sportzentral.app | 25 | | |
| | com.boostedproductivity.app | 23 | | |
| ## 🌏 How to Download | |
| ### Download via Hugging Face Python Library or CLI | |
| **Step 1: Install the library:** | |
| ```bash | |
| pip install huggingface_hub | |
| ``` | |
| Before downloading, ensure you are logged in with your Hugging Face token. If you don't have a token, create an `Access Token` on [Hugging Face](https://huggingface.co/settings/tokens). | |
| **Step 2: Login with your token:** | |
| ```bash | |
| huggingface-cli login | |
| ``` | |
| Follow the prompts to input your token. | |
| --- | |
| #### **Option 1: Download via Python Script** | |
| **Download specific files:** | |
| Use the `hf_hub_download` method to download individual files: | |
| ```python | |
| from huggingface_hub import hf_hub_download | |
| # Download a single file | |
| hf_hub_download(repo_id="mllmTeam/MobileViews", filename="MobileViews_Screenshots_ViewHierarchies/Zip_Files/MobileViews_0-150000.zip", repo_type="dataset", local_dir="/path/to/your_local_dir") | |
| ``` | |
| **Download the entire repository:** | |
| Use the `snapshot_download` method to download the entire dataset: | |
| ```python | |
| from huggingface_hub import snapshot_download | |
| # Download the entire repository | |
| snapshot_download(repo_id="mllmTeam/MobileViews", repo_type="dataset", local_dir="/path/to/your_local_dir") | |
| ``` | |
| --- | |
| #### **Option 2: Download via Hugging Face CLI** | |
| **Download specific files:** | |
| ```bash | |
| huggingface-cli download --repo-type dataset --resume-download mllmTeam/MobileViews/[FILE_PATH] --local-dir [LOCAL_DIRECTORY] --local-dir-use-symlinks False | |
| # Example | |
| huggingface-cli download --repo-type dataset --resume-download mllmTeam/MobileViews/MobileViews_Screenshots_ViewHierarchies/Parquets/MobileViews_0-150000.parquet --local-dir ./mobileviews_dataset --local-dir-use-symlinks False | |
| ``` | |
| **Download the entire repository:** | |
| ```bash | |
| huggingface-cli download --repo-type dataset --resume-download mllmTeam/MobileViews --local-dir [LOCAL_DIRECTORY] --local-dir-use-symlinks False | |
| # Example | |
| huggingface-cli download --repo-type dataset --resume-download mllmTeam/MobileViews --local-dir ./local_dataset --local-dir-use-symlinks False | |
| ``` | |
| If the download is interrupted, run the command again, and it will resume from the last completed point. | |
| ### References | |
| For more parameters and advanced usage, refer to the official documentation: | |
| - [`hf_hub_download` Documentation](https://huggingface.co/docs/huggingface_hub/v0.27.0.rc0/en/package_reference/file_download#huggingface_hub.hf_hub_download) | |
| - [`snapshot_download` Documentation](https://huggingface.co/docs/huggingface_hub/v0.27.0.rc0/en/package_reference/file_download#huggingface_hub.snapshot_download) | |
| - [`Hugging Face CLI` Documentation](https://huggingface.co/docs/huggingface_hub/guides/cli#huggingface-cli-download) | |
| ## 📋 Usage Guidelines | |
| ### Using `zip` and `parquet` Files in `MobileViews_Screenshots_ViewHierarchies` | |
| To verify file integrity before using the `zip` files, follow the steps below. | |
| **Zip File Example** | |
| ```bash | |
| # Follow these steps to validate and extract MobileViews_0-150000.zip before using its contents. | |
| zip -T MobileViews_0-150000.zip # Expected output: test of MobileViews_0-150000.zip OK | |
| # Verify file counts for JSON and JPG files | |
| unzip -l MobileViews_0-150000.zip | grep ".json" | wc -l # Expected: 150001 | |
| unzip -l MobileViews_0-150000.zip | grep ".jpg" | wc -l # Expected: 150001 | |
| # Check file size and SHA256 checksum | |
| du -sh MobileViews_0-150000.zip # Expected: 23G | |
| sha256sum -c MobileViews_0-150000.zip.sha256 # Expected: MobileViews_0-150000.zip: OK | |
| # Unzip | |
| unzip MobileViews_0-150000.zip | |
| ``` | |
| **Parquet File Usage** | |
| Parquet files are a columnar storage format that allows for efficient data handling, especially for large datasets. Each `.parquet` file contains binary data for screenshots and JSON data for VHs. | |
| To explore or extract data from `.parquet` files, use the `useparquet.py` script provided. This script includes helpful functions, such as `check_row_count`, `save_n_images_and_jsons`, and `save_all_images_and_jsons`, to facilitate quick access to images and VHs. | |
| ```bash | |
| pip install pyarrow | |
| # Uncomment the function you need and run the helper script to interact with the .parquet file | |
| python path/to/useparquet.py | |
| ``` | |
| ### Mapping Screenshots and States in `MobileViews_Apps_CompleteTraces` | |
| Each app's folder contains screenshots, states, and actions data. Use our screenshot-state mapping script (`MobileViews_Apps_CompleteTraces/screenshot_state_mapping.py`) to generate a CSV file mapping `screen_id`, `state_str (a unique hash representing each screenshot)`, `structure_str (a hash focusing on UI structure only)`, `vh_json_id` and `vh_xml_id`. | |
| The script provides two main functions: | |
| - `process_single_folder(single_folder_path)` for one apk folder | |
| - `process_multiple_folders(parent_folder_path)` for multiple APK folders | |
| ```bash | |
| # Specify your folder path and uncomment the desired function: | |
| # Run the script | |
| python path/to/screenshot_state_mapping.py | |
| ``` | |
| You can also find the example output in `MobileViews_Apps_CompleteTraces/OneExample.zip` | |
| ## 🌟 Future Updates and Feedback | |
| We’re continuously expanding the `MobileViews` dataset by crawling more apps and capturing a wider range of interactions. Future releases will bring even more data, making `MobileViews` an increasingly valuable resource for mobile UI research. | |
| If you have any questions, encounter issues, or want to share feedback, please don’t hesitate to reach out via email or leave a comment. We’re here to help and genuinely appreciate suggestions that could improve the dataset. Your insights are invaluable as we work to make `MobileViews` as helpful and impactful as possible for the research community. | |
| Thank you for your support and for helping us grow `MobileViews`! | |
| ## 🔖 Citation | |
| If you use this dataset in your research, please cite our work as follows: | |
| ``` | |
| @misc{gao2024mobileviewslargescalemobilegui, | |
| title={MobileViews: A Large-Scale Mobile GUI Dataset}, | |
| author={Longxi Gao and Li Zhang and Shihe Wang and Shangguang Wang and Yuanchun Li and Mengwei Xu}, | |
| year={2024}, | |
| eprint={2409.14337}, | |
| archivePrefix={arXiv}, | |
| primaryClass={cs.HC}, | |
| url={https://arxiv.org/abs/2409.14337}, | |
| } | |
| ``` | |