{ "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 }