Datasets:
PastaAddict commited on
Commit ·
60b6a8b
1
Parent(s): 0d1f205
Stop tracking exploration.ipynb
Browse files- prepare.ipynb +0 -186
prepare.ipynb
DELETED
|
@@ -1,186 +0,0 @@
|
|
| 1 |
-
{
|
| 2 |
-
"cells": [
|
| 3 |
-
{
|
| 4 |
-
"cell_type": "code",
|
| 5 |
-
"execution_count": 1,
|
| 6 |
-
"metadata": {},
|
| 7 |
-
"outputs": [],
|
| 8 |
-
"source": [
|
| 9 |
-
"import os"
|
| 10 |
-
]
|
| 11 |
-
},
|
| 12 |
-
{
|
| 13 |
-
"cell_type": "code",
|
| 14 |
-
"execution_count": 2,
|
| 15 |
-
"metadata": {},
|
| 16 |
-
"outputs": [],
|
| 17 |
-
"source": [
|
| 18 |
-
"verbs_file = \"/home/kristi/Desktop/action_verbs/Action-Verbs/action_verbs.txt\"\n",
|
| 19 |
-
"\n",
|
| 20 |
-
"with open(verbs_file, \"r\") as f:\n",
|
| 21 |
-
" action_verbs = [line.strip() for line in f if line.strip()]"
|
| 22 |
-
]
|
| 23 |
-
},
|
| 24 |
-
{
|
| 25 |
-
"cell_type": "code",
|
| 26 |
-
"execution_count": 4,
|
| 27 |
-
"metadata": {},
|
| 28 |
-
"outputs": [
|
| 29 |
-
{
|
| 30 |
-
"name": "stdout",
|
| 31 |
-
"output_type": "stream",
|
| 32 |
-
"text": [
|
| 33 |
-
"Directory structure created successfully.\n"
|
| 34 |
-
]
|
| 35 |
-
}
|
| 36 |
-
],
|
| 37 |
-
"source": [
|
| 38 |
-
"base_dir = \"/home/kristi/Desktop/action_verbs/Action-Verbs\"\n",
|
| 39 |
-
"video_dir = os.path.join(base_dir, \"videos\")\n",
|
| 40 |
-
"image_dir = os.path.join(base_dir, \"images\")\n",
|
| 41 |
-
"\n",
|
| 42 |
-
"os.makedirs(video_dir, exist_ok=True)\n",
|
| 43 |
-
"os.makedirs(image_dir, exist_ok=True)\n",
|
| 44 |
-
"\n",
|
| 45 |
-
"for verb in action_verbs:\n",
|
| 46 |
-
" os.makedirs(os.path.join(video_dir, verb), exist_ok=True)\n",
|
| 47 |
-
" os.makedirs(os.path.join(image_dir, verb), exist_ok=True)\n",
|
| 48 |
-
"\n",
|
| 49 |
-
"print(\"Directory structure created successfully.\")"
|
| 50 |
-
]
|
| 51 |
-
},
|
| 52 |
-
{
|
| 53 |
-
"cell_type": "code",
|
| 54 |
-
"execution_count": 5,
|
| 55 |
-
"metadata": {},
|
| 56 |
-
"outputs": [],
|
| 57 |
-
"source": [
|
| 58 |
-
"import os\n",
|
| 59 |
-
"\n",
|
| 60 |
-
"# Root directory where you created your structure\n",
|
| 61 |
-
"base_dir = \"/home/kristi/Desktop/action_verbs/Action-Verbs\"\n",
|
| 62 |
-
"\n",
|
| 63 |
-
"# Walk through the directory structure\n",
|
| 64 |
-
"for root, dirs, files in os.walk(base_dir):\n",
|
| 65 |
-
" if not files:\n",
|
| 66 |
-
" gitkeep_path = os.path.join(root, \".gitkeep\")\n",
|
| 67 |
-
" open(gitkeep_path, \"w\").close()"
|
| 68 |
-
]
|
| 69 |
-
},
|
| 70 |
-
{
|
| 71 |
-
"cell_type": "code",
|
| 72 |
-
"execution_count": 9,
|
| 73 |
-
"metadata": {},
|
| 74 |
-
"outputs": [],
|
| 75 |
-
"source": [
|
| 76 |
-
"import random\n",
|
| 77 |
-
"from collections import defaultdict\n",
|
| 78 |
-
"\n",
|
| 79 |
-
"# Load verbs from file\n",
|
| 80 |
-
"with open(verbs_file, \"r\") as f:\n",
|
| 81 |
-
" verbs = [line.strip() for line in f if line.strip()]\n",
|
| 82 |
-
"\n",
|
| 83 |
-
"# Define student names or usernames\n",
|
| 84 |
-
"students = [\"Jeannie\", \"Xingzhi\", \"Dominic\", \"James\"]\n",
|
| 85 |
-
"\n",
|
| 86 |
-
"# Shuffle and split verbs\n",
|
| 87 |
-
"random.shuffle(verbs)\n",
|
| 88 |
-
"chunks = defaultdict(list)\n",
|
| 89 |
-
"for i, verb in enumerate(verbs):\n",
|
| 90 |
-
" student = students[i % len(students)]\n",
|
| 91 |
-
" chunks[student].append(verb)\n",
|
| 92 |
-
"\n",
|
| 93 |
-
"# Generate markdown\n",
|
| 94 |
-
"md_lines = [\"# 📝 Action Verb Dataset To-Do List\\n\"]\n",
|
| 95 |
-
"\n",
|
| 96 |
-
"for student in students:\n",
|
| 97 |
-
" md_lines.append(f\"## 👤 {student}\")\n",
|
| 98 |
-
" for verb in sorted(chunks[student]):\n",
|
| 99 |
-
" md_lines.append(f\"- [ ] Populate `images/{verb}` and `videos/{verb}` \")\n",
|
| 100 |
-
" md_lines.append(\"\") # Add spacing\n",
|
| 101 |
-
"\n",
|
| 102 |
-
"# Save to markdown file or print\n",
|
| 103 |
-
"markdown_output = \"\\n\".join(md_lines)\n",
|
| 104 |
-
"#with open(\"verb_todo_issue.md\", \"w\") as f:\n",
|
| 105 |
-
"# f.write(markdown_output)\n",
|
| 106 |
-
"\n",
|
| 107 |
-
"#print(\"✅ To-do list saved to `verb_todo_issue.md`\")\n"
|
| 108 |
-
]
|
| 109 |
-
},
|
| 110 |
-
{
|
| 111 |
-
"cell_type": "code",
|
| 112 |
-
"execution_count": 10,
|
| 113 |
-
"metadata": {},
|
| 114 |
-
"outputs": [
|
| 115 |
-
{
|
| 116 |
-
"name": "stdout",
|
| 117 |
-
"output_type": "stream",
|
| 118 |
-
"text": [
|
| 119 |
-
"# 📝 Action Verb Dataset To-Do List\n",
|
| 120 |
-
"\n",
|
| 121 |
-
"## 👤 Jeannie\n",
|
| 122 |
-
"- [ ] Populate `images/bending over` and `videos/bending over` \n",
|
| 123 |
-
"- [ ] Populate `images/calling` and `videos/calling` \n",
|
| 124 |
-
"- [ ] Populate `images/crawling` and `videos/crawling` \n",
|
| 125 |
-
"- [ ] Populate `images/dancing` and `videos/dancing` \n",
|
| 126 |
-
"- [ ] Populate `images/singing` and `videos/singing` \n",
|
| 127 |
-
"- [ ] Populate `images/sliding` and `videos/sliding` \n",
|
| 128 |
-
"- [ ] Populate `images/talking` and `videos/talking` \n",
|
| 129 |
-
"\n",
|
| 130 |
-
"## 👤 Xingzhi\n",
|
| 131 |
-
"- [ ] Populate `images/flying` and `videos/flying` \n",
|
| 132 |
-
"- [ ] Populate `images/pointing` and `videos/pointing` \n",
|
| 133 |
-
"- [ ] Populate `images/reading` and `videos/reading` \n",
|
| 134 |
-
"- [ ] Populate `images/scratching` and `videos/scratching` \n",
|
| 135 |
-
"- [ ] Populate `images/skipping` and `videos/skipping` \n",
|
| 136 |
-
"- [ ] Populate `images/sleeping` and `videos/sleeping` \n",
|
| 137 |
-
"- [ ] Populate `images/waving` and `videos/waving` \n",
|
| 138 |
-
"\n",
|
| 139 |
-
"## 👤 Dominic\n",
|
| 140 |
-
"- [ ] Populate `images/digging` and `videos/digging` \n",
|
| 141 |
-
"- [ ] Populate `images/knocking` and `videos/knocking` \n",
|
| 142 |
-
"- [ ] Populate `images/melting` and `videos/melting` \n",
|
| 143 |
-
"- [ ] Populate `images/painting` and `videos/painting` \n",
|
| 144 |
-
"- [ ] Populate `images/running` and `videos/running` \n",
|
| 145 |
-
"- [ ] Populate `images/skiing` and `videos/skiing` \n",
|
| 146 |
-
"- [ ] Populate `images/smelling` and `videos/smelling` \n",
|
| 147 |
-
"\n",
|
| 148 |
-
"## 👤 James\n",
|
| 149 |
-
"- [ ] Populate `images/combing` and `videos/combing` \n",
|
| 150 |
-
"- [ ] Populate `images/jumping` and `videos/jumping` \n",
|
| 151 |
-
"- [ ] Populate `images/sitting` and `videos/sitting` \n",
|
| 152 |
-
"- [ ] Populate `images/skating` and `videos/skating` \n",
|
| 153 |
-
"- [ ] Populate `images/standing up` and `videos/standing up` \n",
|
| 154 |
-
"- [ ] Populate `images/swimming` and `videos/swimming` \n",
|
| 155 |
-
"- [ ] Populate `images/swingling` and `videos/swingling` \n",
|
| 156 |
-
"\n"
|
| 157 |
-
]
|
| 158 |
-
}
|
| 159 |
-
],
|
| 160 |
-
"source": [
|
| 161 |
-
"print(markdown_output)"
|
| 162 |
-
]
|
| 163 |
-
}
|
| 164 |
-
],
|
| 165 |
-
"metadata": {
|
| 166 |
-
"kernelspec": {
|
| 167 |
-
"display_name": "base",
|
| 168 |
-
"language": "python",
|
| 169 |
-
"name": "python3"
|
| 170 |
-
},
|
| 171 |
-
"language_info": {
|
| 172 |
-
"codemirror_mode": {
|
| 173 |
-
"name": "ipython",
|
| 174 |
-
"version": 3
|
| 175 |
-
},
|
| 176 |
-
"file_extension": ".py",
|
| 177 |
-
"mimetype": "text/x-python",
|
| 178 |
-
"name": "python",
|
| 179 |
-
"nbconvert_exporter": "python",
|
| 180 |
-
"pygments_lexer": "ipython3",
|
| 181 |
-
"version": "3.9.13"
|
| 182 |
-
}
|
| 183 |
-
},
|
| 184 |
-
"nbformat": 4,
|
| 185 |
-
"nbformat_minor": 2
|
| 186 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|