feat: add new Jupyter notebook for image transformation and dataset handling

This commit is contained in:
fada
2025-06-13 14:35:10 +08:00
parent 13ae2f0898
commit deafb8c3fc
12 changed files with 757 additions and 66 deletions

View File

@ -1,63 +1,30 @@
{
"cells": [
{
"metadata": {},
"cell_type": "code",
"id": "initial_id",
"metadata": {
"collapsed": true,
"ExecuteTime": {
"end_time": "2025-06-11T07:39:14.997108Z",
"start_time": "2025-06-11T07:39:14.986047Z"
}
},
"outputs": [],
"execution_count": null,
"source": [
"from PIL import Image\n",
"\n",
"im = Image.open('./data/jk.jpg')\n",
"im = Image.open('data/images/jk.jpg')\n",
"im.size"
],
"outputs": [
{
"data": {
"text/plain": [
"(318, 116)"
]
},
"execution_count": 73,
"metadata": {},
"output_type": "execute_result"
}
],
"execution_count": 73
"id": "306b84c8b2d7bc36"
},
{
"metadata": {
"ExecuteTime": {
"end_time": "2025-06-11T07:39:22.279332Z",
"start_time": "2025-06-11T07:39:22.267501Z"
}
},
"metadata": {},
"cell_type": "code",
"outputs": [],
"execution_count": null,
"source": [
"import numpy as np\n",
"\n",
"im_pillow = np.asarray(im)\n",
"im_pillow.shape"
],
"id": "e10b9e7640af00c9",
"outputs": [
{
"data": {
"text/plain": [
"(116, 318, 3)"
]
},
"execution_count": 74,
"metadata": {},
"output_type": "execute_result"
}
],
"execution_count": 74
"id": "627463cc80a9eea4"
},
{
"metadata": {
@ -99,7 +66,7 @@
"source": [
"import cv2\n",
"\n",
"im_cv2 = cv2.imread('./data/jk.jpg')\n",
"im_cv2 = cv2.imread('./data/images/jk.jpg')\n",
"print(type(im_cv2))\n",
"\n",
"print(im_cv2.shape)"