{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "c:\\Users\\hiroga\\miniconda3\\envs\\pokemon-pal\\Lib\\site-packages\\tqdm\\auto.py:21: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html\n", " from .autonotebook import tqdm as notebook_tqdm\n" ] } ], "source": [ "import sys\n", "sys.path.append('..')\n", "\n", "from src.pipeline import *" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "create_tables_if_not_exists()" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "from PIL import Image\n", "\n", "path = root_dir(\"data_examples/lamball_image.webp\")\n", "image = Image.open(path)\n", "hash = calculate_hash(image)\n", "metadata_sample = Metadata(\n", " bucket=path,\n", " path=\"lamball\",\n", " step=Step.raw,\n", " label=Label.pal,\n", " created_at=datetime.now()\n", ")\n", "create_metadata(metadata_sample)\n" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Metadata(bucket='c:\\\\Users\\\\hiroga\\\\Documents\\\\GitHub\\\\til\\\\computer-science\\\\machine-learning\\\\_src\\\\pokemon-palworld\\\\data\\\\raw', path='pocketpair\\\\paldeck_no_001\\\\frame_1.png', step='raw', label='pal', created_at='2024-02-05 02:40:45.161488')\n", "Metadata(bucket='c:\\\\Users\\\\hiroga\\\\Documents\\\\GitHub\\\\til\\\\computer-science\\\\machine-learning\\\\_src\\\\pokemon-palworld\\\\data\\\\raw', path='pocketpair\\\\paldeck_no_001\\\\frame_10.png', step='raw', label='pal', created_at='2024-02-05 02:40:45.172047')\n", "Metadata(bucket='c:\\\\Users\\\\hiroga\\\\Documents\\\\GitHub\\\\til\\\\computer-science\\\\machine-learning\\\\_src\\\\pokemon-palworld\\\\data\\\\raw', path='pocketpair\\\\paldeck_no_001\\\\frame_11.png', step='raw', label='pal', created_at='2024-02-05 02:40:45.176047')\n" ] } ], "source": [ "from datetime import datetime\n", "\n", "# Define the date after which the data was created\n", "date_after = datetime.strptime('2024-01-01', '%Y-%m-%d')\n", "\n", "# Read the metadata\n", "metadata = read_metadata_from(Step.raw, date_after)\n", "\n", "# Print the first 3 rows\n", "for row in metadata[:3]:\n", " print(row)\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "pokemon-pal", "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.11.7" } }, "nbformat": 4, "nbformat_minor": 2 }