Datasets:
Update README.md
Browse files
README.md
CHANGED
|
@@ -21,4 +21,82 @@ dataset_info:
|
|
| 21 |
num_examples: 7997
|
| 22 |
download_size: 1178990085
|
| 23 |
dataset_size: 1258281789.658
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
num_examples: 7997
|
| 22 |
download_size: 1178990085
|
| 23 |
dataset_size: 1258281789.658
|
| 24 |
+
task_categories:
|
| 25 |
+
- object-detection
|
| 26 |
+
tags:
|
| 27 |
+
- ui
|
| 28 |
+
- design
|
| 29 |
+
- detection
|
| 30 |
+
size_categories:
|
| 31 |
+
- n<1K
|
| 32 |
---
|
| 33 |
+
|
| 34 |
+
# Dataset: Mobile UI Design Detection
|
| 35 |
+
|
| 36 |
+
## Introduction
|
| 37 |
+
|
| 38 |
+
This dataset is designed for object detection tasks with a focus on detecting elements in mobile UI designs. The targeted objects include text, images, and groups. The dataset contains images and object detection boxes, including class labels and location information.
|
| 39 |
+
|
| 40 |
+
## Dataset Content
|
| 41 |
+
|
| 42 |
+
Load the dataset and take a look at an example:
|
| 43 |
+
|
| 44 |
+
```python
|
| 45 |
+
>>> from datasets import load_dataset
|
| 46 |
+
>>>> ds = load_dataset("mrtoy/mobile-ui-design")
|
| 47 |
+
>>> example = ds[0]
|
| 48 |
+
>>> example
|
| 49 |
+
{'width': 375,
|
| 50 |
+
'height': 667,
|
| 51 |
+
'image': <PIL.JpegImagePlugin.JpegImageFile image mode=RGB size=375x667>,
|
| 52 |
+
'objects': {'bbox': [[0.0, 0.0, 375.0, 667.0],
|
| 53 |
+
[0.0, 0.0, 375.0, 667.0],
|
| 54 |
+
[0.0, 0.0, 375.0, 20.0],
|
| 55 |
+
...
|
| 56 |
+
],
|
| 57 |
+
'category': ['artboard',
|
| 58 |
+
'rectangle',
|
| 59 |
+
'rectangle',
|
| 60 |
+
...]}}
|
| 61 |
+
```
|
| 62 |
+
|
| 63 |
+
The dataset has the following fields:
|
| 64 |
+
|
| 65 |
+
- image: PIL.Image.Image object containing the image.
|
| 66 |
+
- height: The image height.
|
| 67 |
+
- width: The image width.
|
| 68 |
+
- objects: A dictionary containing bounding box metadata for the objects in the image:
|
| 69 |
+
- bbox: The object’s bounding box (xmin,ymin,width,height).
|
| 70 |
+
- category: The object’s category, with possible values including artboard、rectangle、text、group、...
|
| 71 |
+
|
| 72 |
+
You can visualize the bboxes on the image using some internal torch utilities.
|
| 73 |
+
|
| 74 |
+
```python
|
| 75 |
+
import torch
|
| 76 |
+
from torchvision.ops import box_convert
|
| 77 |
+
from torchvision.utils import draw_bounding_boxes
|
| 78 |
+
from torchvision.transforms.functional import pil_to_tensor, to_pil_image
|
| 79 |
+
|
| 80 |
+
item = ds[0]
|
| 81 |
+
boxes_xywh = torch.tensor(item['objects']['bbox'])
|
| 82 |
+
boxes_xyxy = box_convert(boxes_xywh, 'xywh', 'xyxy')
|
| 83 |
+
to_pil_image(
|
| 84 |
+
draw_bounding_boxes(
|
| 85 |
+
pil_to_tensor(item['image']),
|
| 86 |
+
boxes_xyxy,
|
| 87 |
+
labels=item['objects']['category'],
|
| 88 |
+
)
|
| 89 |
+
)
|
| 90 |
+
```
|
| 91 |
+
|
| 92 |
+
|
| 93 |
+
## Applications
|
| 94 |
+
|
| 95 |
+
This dataset can be used for various applications, such as:
|
| 96 |
+
|
| 97 |
+
- Training and evaluating object detection models for mobile UI designs.
|
| 98 |
+
- Identifying design patterns and trends to aid UI designers and developers in creating high-quality mobile app UIs.
|
| 99 |
+
- Enhancing the automation process in generating UI design templates.
|
| 100 |
+
- Improving image recognition and analysis in the field of mobile UI design.
|
| 101 |
+
|
| 102 |
+
|