{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "%load_ext autoreload\n", "%autoreload 2" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "YOLOv5 🚀 8e8cb19 Python-3.8.10 torch-1.12.1+cu116 CUDA:0 (NVIDIA GeForce RTX 3080, 10015MiB)\n", "\n", "Fusing layers... \n", "Model summary: 157 layers, 7012822 parameters, 0 gradients, 15.8 GFLOPs\n" ] } ], "source": [ "import sys\n", "# sys.path.append(\"./yolo5/\")\n", "from inference import run\n", "import matplotlib.pyplot as plt\n", "from app_utils import bucket_sort, do_sorting\n", "import pandas as pd\n", "import numpy as np \n", "import streamlit as st \n", "import cv2\n", "from tempfile import NamedTemporaryFile\n", "\n", "app_formal_name = \"Planogram Compliance\"\n", "\n", "# Start the app in wide-mode\n", "st.set_page_config(\n", " layout=\"wide\", page_title=app_formal_name,\n", ")\n", "\n", "result_list = run(weights='best_sku_model.pt',\n", " source=\"tmp.png\", imgsz=[640, 640])\n" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " | xmin | \n", "ymin | \n", "xmax | \n", "ymax | \n", "conf | \n", "cls | \n", "
---|---|---|---|---|---|---|
0 | \n", "291.0 | \n", "311.0 | \n", "353.0 | \n", "514.0 | \n", "0.932245 | \n", "0.0 | \n", "
1 | \n", "742.0 | \n", "331.0 | \n", "804.0 | \n", "524.0 | \n", "0.913796 | \n", "0.0 | \n", "
2 | \n", "676.0 | \n", "330.0 | \n", "737.0 | \n", "522.0 | \n", "0.911921 | \n", "0.0 | \n", "
3 | \n", "805.0 | \n", "336.0 | \n", "867.0 | \n", "528.0 | \n", "0.910817 | \n", "0.0 | \n", "
4 | \n", "726.0 | \n", "571.0 | \n", "785.0 | \n", "735.0 | \n", "0.909886 | \n", "0.0 | \n", "