Spaces:
Runtime error
Runtime error
Commit
·
25e66b2
1
Parent(s):
4ee0746
task: move data production
Browse files
analyze_designs.py → data_collection/analyze_designs.py
RENAMED
|
File without changes
|
notebook.ipynb → data_collection/notebook.ipynb
RENAMED
|
@@ -13,15 +13,72 @@
|
|
| 13 |
},
|
| 14 |
{
|
| 15 |
"cell_type": "code",
|
| 16 |
-
"execution_count":
|
| 17 |
"metadata": {},
|
| 18 |
"outputs": [
|
| 19 |
{
|
| 20 |
"name": "stdout",
|
| 21 |
"output_type": "stream",
|
| 22 |
"text": [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
"Testing scraper with design 010...\n",
|
| 24 |
"010: Response status: 200\n",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
"Success!\n"
|
| 26 |
]
|
| 27 |
}
|
|
@@ -31,8 +88,8 @@
|
|
| 31 |
"import asyncio\n",
|
| 32 |
"\n",
|
| 33 |
"# Pick from a range of 001 to 221\n",
|
| 34 |
-
"
|
| 35 |
-
"test_set = [\"010\"]\n",
|
| 36 |
"async def test_scraper(ids):\n",
|
| 37 |
" for test_design_id in ids:\n",
|
| 38 |
" try:\n",
|
|
@@ -74,13 +131,13 @@
|
|
| 74 |
}
|
| 75 |
],
|
| 76 |
"source": [
|
| 77 |
-
"from analyze_designs import analyze_screenshot\n",
|
| 78 |
"from pathlib import Path\n",
|
| 79 |
"import asyncio\n",
|
| 80 |
"\n",
|
| 81 |
"async def test_analyzer():\n",
|
| 82 |
" for design_id in test_set:\n",
|
| 83 |
-
" design_path = Path(f\"designs/{design_id}\")\n",
|
| 84 |
" result = await analyze_screenshot(design_id, design_path)\n",
|
| 85 |
" \n",
|
| 86 |
" if result[1] is not None: # If analysis was successful\n",
|
|
|
|
| 13 |
},
|
| 14 |
{
|
| 15 |
"cell_type": "code",
|
| 16 |
+
"execution_count": 3,
|
| 17 |
"metadata": {},
|
| 18 |
"outputs": [
|
| 19 |
{
|
| 20 |
"name": "stdout",
|
| 21 |
"output_type": "stream",
|
| 22 |
"text": [
|
| 23 |
+
"Testing scraper with design 001...\n",
|
| 24 |
+
"001: Response status: 200\n",
|
| 25 |
+
"Success!\n",
|
| 26 |
+
"Testing scraper with design 002...\n",
|
| 27 |
+
"002: Response status: 200\n",
|
| 28 |
+
"Success!\n",
|
| 29 |
+
"Testing scraper with design 003...\n",
|
| 30 |
+
"003: Response status: 200\n",
|
| 31 |
+
"Success!\n",
|
| 32 |
+
"Testing scraper with design 004...\n",
|
| 33 |
+
"004: Response status: 200\n",
|
| 34 |
+
"Success!\n",
|
| 35 |
+
"Testing scraper with design 005...\n",
|
| 36 |
+
"005: Response status: 200\n",
|
| 37 |
+
"Success!\n",
|
| 38 |
+
"Testing scraper with design 006...\n",
|
| 39 |
+
"006: Response status: 200\n",
|
| 40 |
+
"Success!\n",
|
| 41 |
+
"Testing scraper with design 007...\n",
|
| 42 |
+
"007: Response status: 200\n",
|
| 43 |
+
"Success!\n",
|
| 44 |
+
"Testing scraper with design 008...\n",
|
| 45 |
+
"008: Response status: 200\n",
|
| 46 |
+
"Success!\n",
|
| 47 |
+
"Testing scraper with design 009...\n",
|
| 48 |
+
"009: Response status: 200\n",
|
| 49 |
+
"Success!\n",
|
| 50 |
"Testing scraper with design 010...\n",
|
| 51 |
"010: Response status: 200\n",
|
| 52 |
+
"Success!\n",
|
| 53 |
+
"Testing scraper with design 011...\n",
|
| 54 |
+
"011: Response status: 200\n",
|
| 55 |
+
"Success!\n",
|
| 56 |
+
"Testing scraper with design 012...\n",
|
| 57 |
+
"012: Response status: 200\n",
|
| 58 |
+
"Success!\n",
|
| 59 |
+
"Testing scraper with design 013...\n",
|
| 60 |
+
"013: Response status: 200\n",
|
| 61 |
+
"Success!\n",
|
| 62 |
+
"Testing scraper with design 014...\n",
|
| 63 |
+
"014: Response status: 200\n",
|
| 64 |
+
"Success!\n",
|
| 65 |
+
"Testing scraper with design 015...\n",
|
| 66 |
+
"015: Response status: 200\n",
|
| 67 |
+
"Success!\n",
|
| 68 |
+
"Testing scraper with design 016...\n",
|
| 69 |
+
"016: Response status: 200\n",
|
| 70 |
+
"Success!\n",
|
| 71 |
+
"Testing scraper with design 017...\n",
|
| 72 |
+
"017: Response status: 200\n",
|
| 73 |
+
"Success!\n",
|
| 74 |
+
"Testing scraper with design 018...\n",
|
| 75 |
+
"018: Response status: 200\n",
|
| 76 |
+
"Success!\n",
|
| 77 |
+
"Testing scraper with design 019...\n",
|
| 78 |
+
"019: Response status: 200\n",
|
| 79 |
+
"Success!\n",
|
| 80 |
+
"Testing scraper with design 020...\n",
|
| 81 |
+
"020: Response status: 200\n",
|
| 82 |
"Success!\n"
|
| 83 |
]
|
| 84 |
}
|
|
|
|
| 88 |
"import asyncio\n",
|
| 89 |
"\n",
|
| 90 |
"# Pick from a range of 001 to 221\n",
|
| 91 |
+
"test_set = [f\"{i:03d}\" for i in range(1, 21)]\n",
|
| 92 |
+
"#test_set = [\"010\"]\n",
|
| 93 |
"async def test_scraper(ids):\n",
|
| 94 |
" for test_design_id in ids:\n",
|
| 95 |
" try:\n",
|
|
|
|
| 131 |
}
|
| 132 |
],
|
| 133 |
"source": [
|
| 134 |
+
"from data_collection.analyze_designs import analyze_screenshot\n",
|
| 135 |
"from pathlib import Path\n",
|
| 136 |
"import asyncio\n",
|
| 137 |
"\n",
|
| 138 |
"async def test_analyzer():\n",
|
| 139 |
" for design_id in test_set:\n",
|
| 140 |
+
" design_path = Path(f\"../designs/{design_id}\")\n",
|
| 141 |
" result = await analyze_screenshot(design_id, design_path)\n",
|
| 142 |
" \n",
|
| 143 |
" if result[1] is not None: # If analysis was successful\n",
|
scraper.py → data_collection/scraper.py
RENAMED
|
File without changes
|