Skip to content
Snippets Groups Projects
recogdice-checkpoint.ipynb 2.05 KiB
Newer Older
{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 32,
   "id": "9330c509-d3bb-49b4-bb6b-6b32496392db",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Requirement already satisfied: numpy in c:\\users\\prisc\\anaconda3\\envs\\tf\\lib\\site-packages (1.26.4)\n"
     ]
    }
   ],
   "source": [
    "!pip install numpy"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "id": "d696d8bb-1f96-4829-bbba-9e4eab24c5ec",
   "metadata": {},
   "outputs": [],
   "source": [
    "import skimage\n",
    "import sklearn\n",
    "import numpy as np\n",
    "import tensorflow as tf\n",
    "import keras\n",
    "import os\n",
    "from PIL import Image\n",
    "from sklearn.model_selection import StratifiedShuffleSplit\n",
    "#import matplotlib\n",
    "\n",
    "dataset_path = os.path.abspath(\"Dataset/Cropped\")\n",
    "\n",
    "# Import labeled dataset.\n",
    "os.listdir(dataset_path)\n",
    "images = []\n",
    "image_labels = []\n",
    "numbers = [\"zero\",\"one\",\"two\",\"three\",\"four\",\"five\",\"six\"]\n",
    "for filename in os.listdir(dataset_path):\n",
    "    images.append(np.array(Image.open(os.path.join(dataset_path,filename))))\n",
    "    image_labels.append(numbers.index(filename.split(sep=\"_\")[0]))\n",
    "\n",
    "# Split into test and training sets.\n",
    "sss = StratifiedShuffleSplit(20,train_size=0.75,random_state=0)\n",
    "#for (train_index,test_index) in split()\n",
    "# Train neural network\n",
    "\n",
    "# Image analysis\n",
    "\n",
    "# Image segmentation.\n",
    "\n",
    "# "
   ]
  }
 ],
 "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.12.7"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}