{ "cells": [ { "cell_type": "markdown", "id": "f5c16e68-e20a-473c-9d0c-557314b32203", "metadata": {}, "source": [ "## Creating the dataset" ] }, { "cell_type": "code", "execution_count": 43, "id": "f4e1aece-855e-4687-81d4-376da67545e2", "metadata": {}, "outputs": [], "source": [ "import os" ] }, { "cell_type": "code", "execution_count": 44, "id": "fadf8ef6-ab1c-46a7-962c-512b61cff8b0", "metadata": {}, "outputs": [], "source": [ "base_path = \"../data/artmakeitsports/\"\n", "folders = [f'{base_path}{file}' for file in os.listdir(base_path)]" ] }, { "cell_type": "code", "execution_count": 45, "id": "99514288-bb6c-4b62-bf0e-f66c86b246b2", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "['../data/artmakeitsports/right',\n", " '../data/artmakeitsports/top',\n", " '../data/artmakeitsports/bruno.jpg',\n", " '../data/artmakeitsports/image_test.jpeg',\n", " '../data/artmakeitsports/train',\n", " '../data/artmakeitsports/t.jpg',\n", " '../data/artmakeitsports/bruno.jpeg',\n", " '../data/artmakeitsports/validation',\n", " '../data/artmakeitsports/left',\n", " '../data/artmakeitsports/hugo.jpeg',\n", " '../data/artmakeitsports/datasets',\n", " '../data/artmakeitsports/bottom']" ] }, "execution_count": 45, "metadata": {}, "output_type": "execute_result" } ], "source": [ "folders" ] }, { "cell_type": "markdown", "id": "9e3b1185-7fa1-4eb5-996f-415fce3f1cf1", "metadata": {}, "source": [ "---" ] }, { "cell_type": "code", "execution_count": 46, "id": "5c0519e8-bbfd-4f6b-ba4a-ae099de57598", "metadata": {}, "outputs": [], "source": [ "import numpy as np" ] }, { "cell_type": "code", "execution_count": 47, "id": "9de6eb5e-0144-45e9-9eb0-faad01a94b66", "metadata": {}, "outputs": [], "source": [ "x = np.array([])\n", "for folder in [\"../data/artmakeitsports/right\", \"../data/artmakeitsports/top\"]:\n", " x = np.append(x, np.array([f\"{folder}/{file}\" for file in os.listdir(folder)]))" ] }, { "cell_type": "code", "execution_count": 48, "id": "f0b773aa-8a55-4fdf-926a-b822e8941526", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "/usr/bin/zsh: /home/rosilva/miniconda3/envs/lori/lib/libtinfo.so.6: no version information available (required by /usr/bin/zsh)\n", "bottom\t bruno.jpg hugo.jpeg\tleft t.jpg train\n", "bruno.jpeg datasets image_test.jpeg\tright top validation\n" ] } ], "source": [ "!ls ../data/artmakeitsports/" ] }, { "cell_type": "code", "execution_count": 49, "id": "b5fde846-d0ac-44f6-83e6-daa74aced018", "metadata": {}, "outputs": [], "source": [ "hugo = [\"../data/artmakeitsports/image_test.jpeg\"]" ] }, { "cell_type": "code", "execution_count": 50, "id": "1f03d876-ed34-4465-961b-b2411aadf35f", "metadata": {}, "outputs": [], "source": [ "hugo = np.array([hugo, hugo])" ] }, { "cell_type": "code", "execution_count": 51, "id": "4b28832b-fee1-4b6b-a8cc-773c8cab4219", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "array([['../data/artmakeitsports/image_test.jpeg'],\n", " ['../data/artmakeitsports/image_test.jpeg']], dtype='