1
0
forked from HQU-gxy/CVTH3PE

Single-person detection and DLT, but there is no complete tracking

This commit is contained in:
2025-07-08 14:06:10 +08:00
parent 492b4fba04
commit 835367cd6d
9 changed files with 1738 additions and 169 deletions

View File

@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
@ -39,7 +39,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 4,
"metadata": {},
"outputs": [
{
@ -92,7 +92,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 5,
"metadata": {},
"outputs": [
{
@ -133,7 +133,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 6,
"metadata": {},
"outputs": [],
"source": [
@ -168,7 +168,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 7,
"metadata": {},
"outputs": [],
"source": [
@ -190,30 +190,58 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 13,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<pre>[{frame_index: 1650, boxes: [[1.19e+03, ..., 884]], kps: [[...]], ...},\n",
" {frame_index: 1651, boxes: [[1.19e+03, ..., 883]], kps: [[...]], ...},\n",
" {frame_index: 1652, boxes: [[1.19e+03, ..., 881]], kps: [[...]], ...},\n",
" {frame_index: 1653, boxes: [[1.19e+03, ..., 882]], kps: [[...]], ...},\n",
" {frame_index: 1654, boxes: [[1.19e+03, ..., 884]], kps: [[...]], ...},\n",
" {frame_index: 1655, boxes: [[1.19e+03, ..., 883]], kps: [[...]], ...},\n",
" {frame_index: 1656, boxes: [[1.19e+03, ..., 883]], kps: [[...]], ...},\n",
" {frame_index: 1657, boxes: [[1.19e+03, ..., 885]], kps: [[...]], ...},\n",
" {frame_index: 1658, boxes: [[1.19e+03, ..., 885]], kps: [[...]], ...},\n",
" {frame_index: 1659, boxes: [[1.19e+03, ..., 885]], kps: [[...]], ...},\n",
" ...,\n",
" {frame_index: 1704, boxes: [[1.4e+03, ..., 862]], kps: [[...]], ...},\n",
" {frame_index: 1705, boxes: [[1.41e+03, ..., 865]], kps: [[...]], ...},\n",
" {frame_index: 1706, boxes: [[1.43e+03, ..., 864]], kps: [[...]], ...},\n",
" {frame_index: 1707, boxes: [[1.44e+03, ..., 845]], kps: [[...]], ...},\n",
" {frame_index: 1708, boxes: [[1.45e+03, ..., 848]], kps: [[...]], ...},\n",
" {frame_index: 1709, boxes: [[1.44e+03, ..., 860]], kps: [[...]], ...},\n",
" {frame_index: 1710, boxes: [[1.46e+03, ..., 858]], kps: [[...]], ...},\n",
" {frame_index: 1711, boxes: [[1.49e+03, ..., 847]], kps: [[...]], ...},\n",
" {frame_index: 1712, boxes: [[1.52e+03, ..., 829]], kps: [[...]], ...}]\n",
"----------------------------------------------------------------------------------------------------------------------------------------------\n",
"backend: cpu\n",
"nbytes: 273.7 kB\n",
"type: 63 * {\n",
" frame_index: int64,\n",
" boxes: var * var * float64,\n",
" kps: var * var * var * float64,\n",
" kps_scores: var * var * float64\n",
"}</pre>"
],
"text/plain": [
"{5603: <Array [{frame_index: 1650, ...}, ..., {...}] type='63 * {frame_index: int6...'>,\n",
" 5605: <Array [{frame_index: 1650, ...}, ..., {...}] type='63 * {frame_index: int6...'>,\n",
" 5608: <Array [{frame_index: 1650, ...}, ..., {...}] type='63 * {frame_index: int6...'>,\n",
" 5609: <Array [{frame_index: 1650, ...}, ..., {...}] type='63 * {frame_index: int6...'>}"
"<Array [{frame_index: 1650, ...}, ..., {...}] type='63 * {frame_index: int6...'>"
]
},
"execution_count": 6,
"execution_count": 13,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"KEYPOINT_DATASET"
"KEYPOINT_DATASET[5603]"
]
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 9,
"metadata": {},
"outputs": [],
"source": [
@ -296,7 +324,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 10,
"metadata": {},
"outputs": [],
"source": [
@ -374,7 +402,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 11,
"metadata": {},
"outputs": [],
"source": [
@ -452,9 +480,31 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 12,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"E0704 11:08:11.573409 46301 pjrt_stream_executor_client.cc:3077] Execution of replica 0 failed: INTERNAL: jaxlib/gpu/solver_handle_pool.cc:37: operation gpusolverDnCreate(&handle) failed: cuSolver internal error\n"
]
},
{
"ename": "XlaRuntimeError",
"evalue": "INTERNAL: jaxlib/gpu/solver_handle_pool.cc:37: operation gpusolverDnCreate(&handle) failed: cuSolver internal error",
"output_type": "error",
"traceback": [
"\u001b[31m---------------------------------------------------------------------------\u001b[39m",
"\u001b[31mXlaRuntimeError\u001b[39m Traceback (most recent call last)",
"\u001b[36mCell\u001b[39m\u001b[36m \u001b[39m\u001b[32mIn[12]\u001b[39m\u001b[32m, line 22\u001b[39m\n\u001b[32m 15\u001b[39m \u001b[38;5;28;01mfor\u001b[39;00m element_camera \u001b[38;5;129;01min\u001b[39;00m cameras:\n\u001b[32m 16\u001b[39m \u001b[38;5;28;01mwith\u001b[39;00m jnp.printoptions(precision=\u001b[32m4\u001b[39m, suppress=\u001b[38;5;28;01mTrue\u001b[39;00m):\n\u001b[32m 17\u001b[39m \u001b[38;5;66;03m# display(element_camera)\u001b[39;00m\n\u001b[32m 18\u001b[39m \u001b[38;5;66;03m# display(element_camera.params.Rt.reshape(-1))\u001b[39;00m\n\u001b[32m 19\u001b[39m \u001b[38;5;66;03m# display(element_camera.params.K.reshape(-1))\u001b[39;00m\n\u001b[32m 20\u001b[39m \n\u001b[32m 21\u001b[39m \u001b[38;5;66;03m# compute camera to object point distance\u001b[39;00m\n\u001b[32m---> \u001b[39m\u001b[32m22\u001b[39m transistion = \u001b[43melement_camera\u001b[49m\u001b[43m.\u001b[49m\u001b[43mparams\u001b[49m\u001b[43m.\u001b[49m\u001b[43mpose_matrix\u001b[49m[:\u001b[32m3\u001b[39m, -\u001b[32m1\u001b[39m]\n\u001b[32m 23\u001b[39m \u001b[38;5;66;03m# display(transistion)\u001b[39;00m\n\u001b[32m 24\u001b[39m \u001b[38;5;66;03m# display(jnp.linalg.norm(transistion).item())\u001b[39;00m\n",
"\u001b[36mFile \u001b[39m\u001b[32m~/Code/CVTH3PE/app/camera/__init__.py:305\u001b[39m, in \u001b[36mCameraParams.pose_matrix\u001b[39m\u001b[34m(self)\u001b[39m\n\u001b[32m 303\u001b[39m t = \u001b[38;5;28mgetattr\u001b[39m(\u001b[38;5;28mself\u001b[39m, \u001b[33m\"\u001b[39m\u001b[33m_pose\u001b[39m\u001b[33m\"\u001b[39m, \u001b[38;5;28;01mNone\u001b[39;00m)\n\u001b[32m 304\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m t \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[32m--> \u001b[39m\u001b[32m305\u001b[39m t = \u001b[43mjnp\u001b[49m\u001b[43m.\u001b[49m\u001b[43mlinalg\u001b[49m\u001b[43m.\u001b[49m\u001b[43minv\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43mRt\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 306\u001b[39m \u001b[38;5;28mobject\u001b[39m.\u001b[34m__setattr__\u001b[39m(\u001b[38;5;28mself\u001b[39m, \u001b[33m\"\u001b[39m\u001b[33m_pose\u001b[39m\u001b[33m\"\u001b[39m, t)\n\u001b[32m 307\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m t\n",
" \u001b[31m[... skipping hidden 5 frame]\u001b[39m\n",
"\u001b[36mFile \u001b[39m\u001b[32m~/Code/CVTH3PE/.venv/lib/python3.12/site-packages/jax/_src/interpreters/pxla.py:1297\u001b[39m, in \u001b[36mExecuteReplicated.__call__\u001b[39m\u001b[34m(self, *args)\u001b[39m\n\u001b[32m 1295\u001b[39m \u001b[38;5;28mself\u001b[39m._handle_token_bufs(result_token_bufs, sharded_runtime_token)\n\u001b[32m 1296\u001b[39m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[32m-> \u001b[39m\u001b[32m1297\u001b[39m results = \u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43mxla_executable\u001b[49m\u001b[43m.\u001b[49m\u001b[43mexecute_sharded\u001b[49m\u001b[43m(\u001b[49m\u001b[43minput_bufs\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 1299\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m dispatch.needs_check_special():\n\u001b[32m 1300\u001b[39m out_arrays = results.disassemble_into_single_device_arrays()\n",
"\u001b[31mXlaRuntimeError\u001b[39m: INTERNAL: jaxlib/gpu/solver_handle_pool.cc:37: operation gpusolverDnCreate(&handle) failed: cuSolver internal error"
]
}
],
"source": [
"camera_list = [\n",
" 5601,\n",
@ -484,7 +534,7 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
@ -710,7 +760,7 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
@ -729,7 +779,7 @@
},
{
"cell_type": "code",
"execution_count": 13,
"execution_count": null,
"metadata": {},
"outputs": [
{
@ -762,7 +812,7 @@
},
{
"cell_type": "code",
"execution_count": 14,
"execution_count": null,
"metadata": {},
"outputs": [
{
@ -786,7 +836,7 @@
},
{
"cell_type": "code",
"execution_count": 15,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
@ -1104,7 +1154,7 @@
},
{
"cell_type": "code",
"execution_count": 16,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
@ -1162,7 +1212,7 @@
},
{
"cell_type": "code",
"execution_count": 17,
"execution_count": null,
"metadata": {},
"outputs": [
{
@ -1185,7 +1235,7 @@
},
{
"cell_type": "code",
"execution_count": 18,
"execution_count": null,
"metadata": {},
"outputs": [
{
@ -1220,7 +1270,7 @@
},
{
"cell_type": "code",
"execution_count": 19,
"execution_count": null,
"metadata": {},
"outputs": [
{
@ -1242,7 +1292,7 @@
},
{
"cell_type": "code",
"execution_count": 20,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
@ -1297,7 +1347,7 @@
},
{
"cell_type": "code",
"execution_count": 21,
"execution_count": null,
"metadata": {},
"outputs": [
{
@ -1316,7 +1366,7 @@
},
{
"cell_type": "code",
"execution_count": 22,
"execution_count": null,
"metadata": {},
"outputs": [
{
@ -2973,7 +3023,7 @@
},
{
"cell_type": "code",
"execution_count": 23,
"execution_count": null,
"metadata": {},
"outputs": [
{
@ -3004,7 +3054,7 @@
},
{
"cell_type": "code",
"execution_count": 24,
"execution_count": null,
"metadata": {},
"outputs": [
{
@ -3051,7 +3101,7 @@
},
{
"cell_type": "code",
"execution_count": 25,
"execution_count": null,
"metadata": {},
"outputs": [
{
@ -3071,7 +3121,7 @@
},
{
"cell_type": "code",
"execution_count": 26,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
@ -3085,7 +3135,7 @@
},
{
"cell_type": "code",
"execution_count": 27,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
@ -3107,7 +3157,7 @@
},
{
"cell_type": "code",
"execution_count": 28,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
@ -3140,7 +3190,7 @@
},
{
"cell_type": "code",
"execution_count": 29,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
@ -3158,7 +3208,7 @@
},
{
"cell_type": "code",
"execution_count": 30,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
@ -3172,7 +3222,7 @@
},
{
"cell_type": "code",
"execution_count": 31,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
@ -3196,7 +3246,7 @@
],
"metadata": {
"kernelspec": {
"display_name": ".venv",
"display_name": "cvth3pe",
"language": "python",
"name": "python3"
},