114 lines
2.5 KiB
Plaintext
Executable File
114 lines
2.5 KiB
Plaintext
Executable File
{
|
|
"cells": [
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 1,
|
|
"id": "50d8ca6f-b598-42c1-899c-b1ba79626ea3",
|
|
"metadata": {
|
|
"ExecuteTime": {
|
|
"end_time": "2024-06-14T12:51:26.187962Z",
|
|
"start_time": "2024-06-14T12:51:26.053976Z"
|
|
}
|
|
},
|
|
"outputs": [],
|
|
"source": [
|
|
"import os\n",
|
|
"import cv2\n",
|
|
"import json\n",
|
|
"import glob\n",
|
|
"import seaborn as sns\n",
|
|
"import numpy as np\n",
|
|
"import matplotlib.pyplot as plt\n",
|
|
"\n",
|
|
"from PIL import Image\n",
|
|
"from skimage.measure import label\n",
|
|
"from skimage.measure import regionprops\n",
|
|
"from utils.labelme import save_pred_to_json"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"id": "ae3b40f8-562b-4e5f-b932-6509312dfbf4",
|
|
"metadata": {},
|
|
"source": [
|
|
"# Results 2 Json"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 2,
|
|
"id": "c17ce107-cac1-4b58-96f2-a183adb730d6",
|
|
"metadata": {
|
|
"ExecuteTime": {
|
|
"end_time": "2024-06-14T12:51:26.190673Z",
|
|
"start_time": "2024-06-14T12:51:26.188703Z"
|
|
}
|
|
},
|
|
"outputs": [],
|
|
"source": [
|
|
"json_path = '/home/gao/mouclear/cc/code/msunet/logs/0/version_3/end-to-end-test.json'\n",
|
|
"save_path = '/home/gao/mouclear/cc/data/end-to-end-result/patch_unet/after_test'\n",
|
|
"\n",
|
|
"os.makedirs(save_path, exist_ok=True)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 3,
|
|
"id": "a1328c78-b657-488c-a444-fa737732e6b3",
|
|
"metadata": {
|
|
"ExecuteTime": {
|
|
"end_time": "2024-06-14T12:52:45.131029Z",
|
|
"start_time": "2024-06-14T12:51:26.191718Z"
|
|
}
|
|
},
|
|
"outputs": [
|
|
{
|
|
"name": "stdout",
|
|
"output_type": "stream",
|
|
"text": [
|
|
"4694 3\n"
|
|
]
|
|
}
|
|
],
|
|
"source": [
|
|
"save_pred_to_json(json_path, save_path)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 3,
|
|
"id": "b026e354-a04f-4f93-99c7-6159e94391c3",
|
|
"metadata": {
|
|
"ExecuteTime": {
|
|
"end_time": "2024-06-14T12:52:45.133006Z",
|
|
"start_time": "2024-06-14T12:52:45.131708Z"
|
|
}
|
|
},
|
|
"outputs": [],
|
|
"source": []
|
|
}
|
|
],
|
|
"metadata": {
|
|
"kernelspec": {
|
|
"name": "python3",
|
|
"language": "python",
|
|
"display_name": "Python 3 (ipykernel)"
|
|
},
|
|
"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.8.16"
|
|
}
|
|
},
|
|
"nbformat": 4,
|
|
"nbformat_minor": 5
|
|
}
|