unipic_nano_2images
收藏资源简介:
# Skywork/unipic_nano_2images: A Multi-Image Composition Dataset ## ⚡ Quick Start The image archive is split into multiple parts for easier downloading. To reconstruct and extract: ```bash # Step 1: Concatenate split files into a single zip cat nano-banana-2image_part_* > nano-banana-2images.zip # Step 2: Extract the images unzip nano-banana-2images.zip ``` ## 📖 Overview **UniPic-Nano-2Images** is a high-quality multi-image composition dataset containing **41,812** samples designed for training image fusion and composition models. Each sample consists of **2 input images** and **1 output image**, where elements from both input images are seamlessly combined based on natural language instructions. This dataset is part of the **UniPic** series and has been used in **UniPic3** for training advanced multi-image composition models. ## 🎨 Demo: Multi-Image Composition This dataset enables models to intelligently combine subjects and objects from two separate images into a single coherent output based on natural language instructions:  *Example: Person from Image1 combined with objects/scenes from Image2 to create a seamless composition* ## 🎯 Key Features - **Multi-Image Input**: Each sample uses exactly 2 input images for composition - **Diverse Composition Tasks**: Covers 18 different composition scenarios including wearing accessories, holding objects, playing instruments, and more - **High Quality**: 41,812 carefully curated samples with natural language instructions - **Production Ready**: Used in UniPic3 for real-world multi-image composition applications - **Simple Format**: Clean JSON format with straightforward input/output structure ## 📊 Dataset Statistics | Task Type | Count | Percentage | Description | |-----------|-------|------------|-------------| | **Wearing Jewelry/Accessories** | 9,721 | 23.2% | Person wearing watches, bracelets, necklaces, rings, earrings | | **Eating Food** | 7,704 | 18.4% | Person eating various food items | | **Holding Other Object** | 6,519 | 15.6% | Person holding miscellaneous objects | | **Playing Instrument** | 4,671 | 11.2% | Person playing musical instruments (guitar, violin, saxophone, etc.) | | **Sitting on Furniture** | 4,323 | 10.3% | Person sitting on chairs, sofas, benches | | **Holding Drink/Container** | 2,175 | 5.2% | Person holding glasses, cups, bottles | | **Wearing Headwear** | 1,653 | 4.0% | Person wearing hats, caps, helmets | | **Holding Everyday Object** | 1,094 | 2.6% | Person holding books, phones, cameras, umbrellas | | **Holding Food** | 921 | 2.2% | Person holding food items | | **Wearing Eyewear** | 643 | 1.5% | Person wearing glasses, sunglasses | | **Holding Flowers** | 553 | 1.3% | Person holding flowers, bouquets | | **Holding Musical Instrument** | 546 | 1.3% | Person holding (not playing) instruments | | **Holding Bag** | 349 | 0.8% | Person holding bags, purses, backpacks | | **Riding Vehicle** | 297 | 0.7% | Person riding bikes, surfboards, skateboards | | **Standing in Scene** | 233 | 0.6% | Person standing in various backgrounds/scenes | | **Other Interaction** | 188 | 0.4% | Other composition types | | **Using Tool/Device** | 181 | 0.4% | Person using various tools or devices | | **Drinking Beverage** | 41 | 0.1% | Person drinking beverages | | **Total** | **41,812** | **100%** | All multi-image composition samples | ## 📁 Dataset Structure ### Data Format Each sample in the dataset is a JSON object with the following structure: ```json { "input_images": ["path/to/image1.png", "path/to/image2.png"], "instruction": "A woman from Image1 is elegantly wearing the gold bracelet from Image2, creating a stylish ensemble.", "output_image": "path/to/fusion_result.png" } ``` ### Field Descriptions - **`input_images`**: List of exactly 2 input image paths - `Image1`: Typically contains the main subject (person) - `Image2`: Typically contains the object/scene to be composed - **`instruction`**: Natural language description of how to combine the two images, following the pattern: - Subject description from Image1 - Action/interaction verb (wearing, holding, sitting on, playing, etc.) - Object description from Image2 - Scene/atmosphere description - **`output_image`**: Path to the composed output image ### Composition Pattern The dataset follows a consistent composition pattern: ``` [Subject from Image1] + [Action] + [Object from Image2] → [Fused Output] ``` Example instructions: - "A man from Image1 is standing on a surfboard from Image2, riding the ocean waves under a bright blue sky." - "A woman in a cream coat from Image1 is elegantly playing the blue violin from Image2, creating a sophisticated and artistic ensemble." - "A woman from Image1 is comfortably sitting on the checkered sofa from Image2, holding a book, creating a cozy atmosphere." ## 🚀 Usage ### Loading the Dataset #### Using Hugging Face Datasets ```python from datasets import load_dataset # Load the dataset from Hugging Face dataset = load_dataset("Skywork/unipic_nano_2images", split="train") # Access a sample sample = dataset[0] print(f"Input images: {sample['input_images']}") print(f"Instruction: {sample['instruction']}") print(f"Output image: {sample['output_image']}") ``` #### Direct JSON Loading ```python import json # Load from local JSONL file samples = [] with open("unipic_nano_2images.jsonl", "r", encoding="utf-8") as f: for line in f: sample = json.loads(line.strip()) samples.append(sample) print(f"Total samples: {len(samples)}") # 41,812 ``` #### Using PyTorch DataLoader ```python from torch.utils.data import Dataset, DataLoader from PIL import Image import json class UniPicNano2ImagesDataset(Dataset): def __init__(self, jsonl_path, image_root): self.samples = [] with open(jsonl_path, "r", encoding="utf-8") as f: for line in f: self.samples.append(json.loads(line.strip())) self.image_root = image_root def __len__(self): return len(self.samples) def __getitem__(self, idx): sample = self.samples[idx] # Load input images img1 = Image.open(f"{self.image_root}/{sample['input_images'][0]}") img2 = Image.open(f"{self.image_root}/{sample['input_images'][1]}") # Load output image output = Image.open(f"{self.image_root}/{sample['output_image']}") return { "input_images": [img1, img2], "instruction": sample["instruction"], "output_image": output } dataset = UniPicNano2ImagesDataset("unipic_nano_2images.jsonl", "images/") dataloader = DataLoader(dataset, batch_size=8, shuffle=True) ``` ### Filtering by Task Type ```python import json import re def categorize_sample(instruction): """Categorize a sample based on its instruction.""" instruction = instruction.lower() if 'wearing' in instruction: if any(x in instruction for x in ['watch', 'bracelet', 'necklace', 'ring', 'earring']): return 'Wearing Jewelry/Accessories' elif any(x in instruction for x in ['hat', 'cap', 'helmet']): return 'Wearing Headwear' elif any(x in instruction for x in ['glasses', 'sunglasses']): return 'Wearing Eyewear' elif 'holding' in instruction: return 'Holding Object' elif 'playing' in instruction: return 'Playing Instrument' elif 'sitting' in instruction: return 'Sitting on Furniture' elif 'eating' in instruction: return 'Eating Food' return 'Other' # Filter samples by category with open("unipic_nano_2images.jsonl", "r") as f: samples = [json.loads(line) for line in f] jewelry_samples = [s for s in samples if categorize_sample(s['instruction']) == 'Wearing Jewelry/Accessories'] print(f"Jewelry samples: {len(jewelry_samples)}") # ~9,721 ``` ## 🔬 Task Categories ### 1. Wearing Compositions (28.7%) Person from Image1 wearing items from Image2: - **Jewelry/Accessories**: Watches, bracelets, necklaces, rings, earrings - **Headwear**: Hats, caps, helmets, visors - **Eyewear**: Glasses, sunglasses ### 2. Holding Compositions (23.8%) Person from Image1 holding objects from Image2: - **Everyday Objects**: Books, phones, cameras, umbrellas - **Food Items**: Fruits, snacks, meals - **Flowers**: Bouquets, roses - **Containers**: Glasses, cups, bottles - **Bags**: Purses, backpacks, handbags ### 3. Activity Compositions (40.6%) Person from Image1 performing activities with items from Image2: - **Playing Instruments**: Guitar, violin, saxophone, trumpet, piano - **Sitting on Furniture**: Chairs, sofas, benches - **Eating Food**: Various food items - **Riding Vehicles**: Bikes, surfboards, skateboards ### 4. Scene Compositions (6.9%) Person from Image1 placed in scenes/backgrounds from Image2: - **Standing in Scene**: Various backgrounds and environments - **Using Tools**: Various tools and devices ## 🎓 Applications This dataset is designed for training and evaluating: - **Multi-Image Composition Models**: Learn to seamlessly combine elements from multiple images - **Instruction-Following Vision Models**: Models that follow natural language composition instructions - **Image Editing Models**: Fine-grained control over image composition - **Subject-Object Fusion**: Intelligent blending of subjects with objects/scenes ## 🔗 Related Work This dataset is part of the **UniPic** dataset series: - **UniPic3**: A unified multi-image composition framework. For more details, see [Skywork UniPic 3.0: Unified Multi-Image Composition via Sequence Modeling](https://arxiv.org/abs/2601.15664) ## 📝 Citation If you use this dataset in your research, please cite: ```bibtex @misc{wei2026skyworkunipic30unified, title={Skywork UniPic 3.0: Unified Multi-Image Composition via Sequence Modeling}, author={Hongyang Wei and Hongbo Liu and Zidong Wang and Yi Peng and Baixin Xu and Size Wu and Xuying Zhang and Xianglong He and Zexiang Liu and Peiyu Wang and Xuchen Song and Yangguang Li and Yang Liu and Yahui Zhou}, year={2026}, eprint={2601.15664}, archivePrefix={arXiv}, primaryClass={cs.CV}, url={https://arxiv.org/abs/2601.15664}, } ``` ```bibtex @misc{wang2025skyworkunipicunifiedautoregressive, title={Skywork UniPic: Unified Autoregressive Modeling for Visual Understanding and Generation}, author={Peiyu Wang and Yi Peng and Yimeng Gan and Liang Hu and Tianyidan Xie and Xiaokun Wang and Yichen Wei and Chuanxin Tang and Bo Zhu and Changshi Li and Hongyang Wei and Eric Li and Xuchen Song and Yang Liu and Yahui Zhou}, year={2025}, eprint={2508.03320}, archivePrefix={arXiv}, primaryClass={cs.CV}, url={https://arxiv.org/abs/2508.03320}, } ``` ## 📄 License Please refer to the license terms on the [Hugging Face dataset page](https://huggingface.co/datasets/Skywork/unipic_nano_2images). ---



