Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
tags:
|
| 4 |
+
- text-to-video
|
| 5 |
+
- prompt-engineering
|
| 6 |
+
- video-generation
|
| 7 |
+
- llm
|
| 8 |
+
- rag
|
| 9 |
+
- research
|
| 10 |
+
datasets:
|
| 11 |
+
- junchenfu/llmpopcorn_prompts
|
| 12 |
+
pipeline_tag: text-generation
|
| 13 |
+
---
|
| 14 |
+
|
| 15 |
+
# LLMPopcorn Usage Instructions
|
| 16 |
+
|
| 17 |
+
Welcome to LLMPopcorn! This guide will help you generate video titles and prompts, as well as create AI-generated videos based on those prompts.
|
| 18 |
+
|
| 19 |
+
## Prerequisites
|
| 20 |
+
|
| 21 |
+
### Install Required Python Packages
|
| 22 |
+
|
| 23 |
+
Before running the scripts, ensure that you have installed the necessary Python packages. You can do this by executing the following command:
|
| 24 |
+
|
| 25 |
+
```bash
|
| 26 |
+
pip install torch transformers diffusers tqdm numpy pandas sentence-transformers faiss-cpu openai huggingface_hub safetensors
|
| 27 |
+
```
|
| 28 |
+
|
| 29 |
+
**Download the MicroLens Dataset**:
|
| 30 |
+
Download the following files from the [MicroLens dataset](https://github.com/westlake-repl/MicroLens) and place them in the `Microlens/` folder:
|
| 31 |
+
|
| 32 |
+
| File | Description |
|
| 33 |
+
|------|-------------|
|
| 34 |
+
| `MicroLens-100k_likes_and_views.txt` | Video engagement stats (tab-separated) |
|
| 35 |
+
| `MicroLens-100k_title_en.csv` | Cover image descriptions (comma-separated) |
|
| 36 |
+
| `Microlens100K_captions_en.csv` | Video captions in English (tab-separated) |
|
| 37 |
+
| `MicroLens-100k_comment_en.txt` | User comments (tab-separated) |
|
| 38 |
+
| `tags_to_summary.csv` | Video category tags (comma-separated) |
|
| 39 |
+
|
| 40 |
+
Your directory structure should look like:
|
| 41 |
+
```
|
| 42 |
+
LLMPopcorn/
|
| 43 |
+
βββ Microlens/
|
| 44 |
+
β βββ MicroLens-100k_likes_and_views.txt
|
| 45 |
+
β βββ MicroLens-100k_title_en.csv
|
| 46 |
+
β βββ Microlens100K_captions_en.csv
|
| 47 |
+
β βββ MicroLens-100k_comment_en.txt
|
| 48 |
+
β βββ tags_to_summary.csv
|
| 49 |
+
βββ PE.py
|
| 50 |
+
βββ pipline.py
|
| 51 |
+
βββ ...
|
| 52 |
+
```
|
| 53 |
+
|
| 54 |
+
## Step 1: Generate Video Titles and Prompts
|
| 55 |
+
|
| 56 |
+
To generate video titles and prompts, run the `LLMPopcorn.py` script:
|
| 57 |
+
```bash
|
| 58 |
+
python LLMPopcorn.py
|
| 59 |
+
```
|
| 60 |
+
|
| 61 |
+
To enhance LLMPopcorn, execute the `PE.py` script:
|
| 62 |
+
```bash
|
| 63 |
+
python PE.py
|
| 64 |
+
```
|
| 65 |
+
|
| 66 |
+
## Step 2: Generate AI Videos
|
| 67 |
+
|
| 68 |
+
To create AI-generated videos, execute the `generating_images_videos_three.py` script:
|
| 69 |
+
```bash
|
| 70 |
+
python generating_images_videos_three.py
|
| 71 |
+
```
|
| 72 |
+
|
| 73 |
+
## Step 3: Clone the Evaluation Code
|
| 74 |
+
|
| 75 |
+
Then, following the instructions in the MMRA repository, you can evaluate the generated videos.
|
| 76 |
+
|
| 77 |
+
## Tutorial: Using the Prompts Dataset
|
| 78 |
+
|
| 79 |
+
You can easily download and use the structured prompts directly from Hugging Face:
|
| 80 |
+
|
| 81 |
+
### 1. Install `datasets`
|
| 82 |
+
```bash
|
| 83 |
+
pip install datasets
|
| 84 |
+
```
|
| 85 |
+
|
| 86 |
+
### 2. Load the Dataset in Python
|
| 87 |
+
```python
|
| 88 |
+
from datasets import load_dataset
|
| 89 |
+
|
| 90 |
+
# Load the LLMPopcorn prompts
|
| 91 |
+
dataset = load_dataset("junchenfu/llmpopcorn_prompts")
|
| 92 |
+
|
| 93 |
+
# Access the data (abstract or concrete)
|
| 94 |
+
for item in dataset["train"]:
|
| 95 |
+
print(f"Type: {item['type']}, Prompt: {item['prompt']}")
|
| 96 |
+
```
|
| 97 |
+
|
| 98 |
+
This dataset contains both abstract and concrete prompts, which you can use as input for the video generation scripts in Step 2.
|