Spaces:
Runtime error
Runtime error
File size: 2,801 Bytes
c4bc1f2 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 |
{
"cells": [
{
"cell_type": "markdown",
"id": "f5c16e68-e20a-473c-9d0c-557314b32203",
"metadata": {},
"source": [
"## Creating the dataset"
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "f4e1aece-855e-4687-81d4-376da67545e2",
"metadata": {},
"outputs": [],
"source": [
"import os"
]
},
{
"cell_type": "code",
"execution_count": 7,
"id": "5c0519e8-bbfd-4f6b-ba4a-ae099de57598",
"metadata": {},
"outputs": [],
"source": [
"import numpy as np"
]
},
{
"cell_type": "code",
"execution_count": 6,
"id": "fadf8ef6-ab1c-46a7-962c-512b61cff8b0",
"metadata": {},
"outputs": [],
"source": [
"base_path = \"../data/wikiart/\""
]
},
{
"cell_type": "code",
"execution_count": 8,
"id": "9de6eb5e-0144-45e9-9eb0-faad01a94b66",
"metadata": {},
"outputs": [],
"source": [
"x = np.array([])\n",
"x = np.append(x, np.array([f\"{base_path}{file}\" for file in os.listdir(base_path)]))"
]
},
{
"cell_type": "code",
"execution_count": 10,
"id": "5d787870-a55e-4322-8df6-bd7b7e3f48da",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(80082,)"
]
},
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"x.shape"
]
},
{
"cell_type": "code",
"execution_count": 11,
"id": "b5fde846-d0ac-44f6-83e6-daa74aced018",
"metadata": {},
"outputs": [],
"source": [
"wikiart_dataset = np.array([x, x])"
]
},
{
"cell_type": "code",
"execution_count": 12,
"id": "f9ab90a1-e78f-4009-9d97-e0a7066c36c3",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(2, 80082)"
]
},
"execution_count": 12,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"wikiart_dataset.shape"
]
},
{
"cell_type": "code",
"execution_count": 13,
"id": "de89352d-6c8c-48ba-a255-f2362d8b8a56",
"metadata": {},
"outputs": [],
"source": [
"np.save(\"../data/artmakeitsports/datasets/wikiart_data\", wikiart_dataset)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "17b6829d-2c2b-4635-8301-9c2c6e738446",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.12"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
|