{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"faster_coco_eval.__version__='1.5.5'\n"
]
}
],
"source": [
"import json\n",
"import logging\n",
"import faster_coco_eval\n",
"from faster_coco_eval import COCO, COCOeval_faster\n",
"from faster_coco_eval.extra import Curves\n",
"\n",
"print(f\"{faster_coco_eval.__version__=}\")\n",
"\n",
"logging.root.setLevel(\"INFO\")\n",
"logging.debug(\"Запись.\")"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"prepared_coco_in_dict = COCO.load_json(\"../tests/synth_test_dataset/test.json\")\n",
"prepared_anns = COCO.load_json(\"../tests/synth_test_dataset/result_data.json\")"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
"iouType = \"keypoints\""
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
"cocoGt = COCO(prepared_coco_in_dict)\n",
"cocoDt = cocoGt.loadRes(prepared_anns)\n",
"\n",
"cocoEval = COCOeval_faster(\n",
" cocoGt, cocoDt, iouType, extra_calc=True, kpt_oks_sigmas=[0.01] * 4\n",
")\n",
"\n",
"cocoEval.evaluate()\n",
"cocoEval.accumulate()\n",
"cocoEval.summarize()"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'AP_all': 0.8877048841154976,\n",
" 'AP_50': 1.0,\n",
" 'AP_75': 1.0,\n",
" 'AP_medium': -1.0,\n",
" 'AP_large': 0.8877048841154976,\n",
" 'AR_all': 0.9267605633802816,\n",
" 'AR_second': 1.0,\n",
" 'AR_third': 1.0,\n",
" 'AR_medium': -1.0,\n",
" 'AR_large': 0.9267605633802816,\n",
" 'mIoU': 0.9378257896663419,\n",
" 'mAUC_50': 1.0}"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"cocoEval.stats_as_dict"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
" \n",
" "
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.plotly.v1+json": {
"config": {
"plotlyServerURL": "https://plot.ly"
},
"data": [
{
"hovertemplate": "%{y:.2f}%
mae: %{x:.2f}
dial_skelet -> center
mae: %{x:.2f}
dial_skelet -> left_value
mae: %{x:.2f}
dial_skelet -> right_value
mae: %{x:.2f}
dial_skelet -> value
mae: %{x:.2f}
dial_skelet -> MEAN