atom-predict/msunet/DataPostprocess.ipynb

154 lines
3.2 KiB
Plaintext
Raw Normal View History

2024-07-09 09:52:24 +08:00
{
"cells": [
{
"cell_type": "code",
"execution_count": 13,
"id": "50d8ca6f-b598-42c1-899c-b1ba79626ea3",
"metadata": {
"ExecuteTime": {
"end_time": "2024-06-21T02:39:32.486045Z",
"start_time": "2024-06-21T02:39:32.483615Z"
}
},
"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": "markdown",
"source": [],
"metadata": {
"collapsed": false
},
"id": "c0ff45ece0c1cbce"
},
{
"cell_type": "code",
"outputs": [],
"source": [],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2024-06-21T02:39:32.487976Z",
"start_time": "2024-06-21T02:39:32.486752Z"
}
},
"id": "6432dcb82eeece17",
"execution_count": 13
},
{
"cell_type": "code",
"execution_count": 14,
"id": "c17ce107-cac1-4b58-96f2-a183adb730d6",
"metadata": {
"ExecuteTime": {
"end_time": "2024-06-21T02:39:32.495688Z",
"start_time": "2024-06-21T02:39:32.488630Z"
}
},
"outputs": [],
"source": [
"json_path = '/home/gao/mouclear/cc/code/msunet/logs/0/version_2/test.json'\n",
"save_path = '/home/gao/mouclear/cc/data/xj-adjust'\n",
"\n",
"os.makedirs(save_path, exist_ok=True)"
]
},
{
"cell_type": "code",
"execution_count": 15,
"id": "a1328c78-b657-488c-a444-fa737732e6b3",
"metadata": {
"ExecuteTime": {
"end_time": "2024-06-21T02:39:32.780077Z",
"start_time": "2024-06-21T02:39:32.496372Z"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"17 3\n",
"52 4\n",
"236 3\n",
"469 3\n",
"510 3\n"
]
}
],
"source": [
"save_pred_to_json(json_path, save_path)"
]
},
{
"cell_type": "code",
"outputs": [],
"source": [],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2024-06-21T02:39:32.782900Z",
"start_time": "2024-06-21T02:39:32.781079Z"
}
},
"id": "b397dc686cd9faed",
"execution_count": 15
},
{
"cell_type": "code",
"execution_count": 15,
"id": "b026e354-a04f-4f93-99c7-6159e94391c3",
"metadata": {
"ExecuteTime": {
"end_time": "2024-06-21T02:39:32.786520Z",
"start_time": "2024-06-21T02:39:32.784766Z"
}
},
"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
}