Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
Jetson-Triton-LPR
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
YONG-LIN SU
Jetson-Triton-LPR
Commits
dc3fe5c1
Commit
dc3fe5c1
authored
Jun 15, 2022
by
Bruce
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rm pycache
parent
9690e1f2
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
142 additions
and
3 deletions
+142
-3
test_camera-checkpoint.ipynb
.ipynb_checkpoints/test_camera-checkpoint.ipynb
+77
-2
EZLPR.cpython-36.pyc
AlprTritonClient/__pycache__/EZLPR.cpython-36.pyc
+0
-0
yolo.cpython-36.pyc
AlprTritonClient/__pycache__/yolo.cpython-36.pyc
+0
-0
yolo_shared_memory.cpython-36.pyc
...ritonClient/__pycache__/yolo_shared_memory.cpython-36.pyc
+0
-0
test_camera.ipynb
test_camera.ipynb
+65
-1
No files found.
.ipynb_checkpoints/test_camera-checkpoint.ipynb
View file @
dc3fe5c1
...
@@ -178,7 +178,18 @@
...
@@ -178,7 +178,18 @@
"name": "stdout",
"name": "stdout",
"output_type": "stream",
"output_type": "stream",
"text": [
"text": [
"30.0\n"
"60.0\n"
]
},
{
"ename": "KeyboardInterrupt",
"evalue": "",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mKeyboardInterrupt\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-2-4323a410c5ab>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[1;32m 32\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mret\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 33\u001b[0m \u001b[0;31m#VioWri.Frame = frame\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 34\u001b[0;31m \u001b[0mwriter\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mwrite\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mframe\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 35\u001b[0m \u001b[0;31m# cv2.imshow(\"1\",frame)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 36\u001b[0m \u001b[0;31m# key=cv2.waitKey(1)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;31mKeyboardInterrupt\u001b[0m: "
]
]
}
}
],
],
...
@@ -511,9 +522,73 @@
...
@@ -511,9 +522,73 @@
},
},
{
{
"cell_type": "code",
"cell_type": "code",
"execution_count":
null
,
"execution_count":
1
,
"id": "78266468",
"id": "78266468",
"metadata": {},
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Saved: Kevin_Car_i_frame_0.jpg\n",
"Saved: Kevin_Car_i_frame_30.jpg\n",
"Saved: Kevin_Car_i_frame_60.jpg\n",
"Saved: Kevin_Car_i_frame_90.jpg\n",
"Saved: Kevin_Car_i_frame_120.jpg\n",
"Saved: Kevin_Car_i_frame_150.jpg\n",
"Saved: Kevin_Car_i_frame_180.jpg\n",
"Saved: Kevin_Car_i_frame_210.jpg\n",
"Saved: Kevin_Car_i_frame_240.jpg\n",
"Saved: Kevin_Car_i_frame_270.jpg\n",
"Saved: Kevin_Car_i_frame_300.jpg\n",
"Saved: Kevin_Car_i_frame_330.jpg\n",
"Saved: Kevin_Car_i_frame_360.jpg\n",
"Saved: Kevin_Car_i_frame_390.jpg\n",
"Saved: Kevin_Car_i_frame_420.jpg\n",
"Saved: Kevin_Car_i_frame_450.jpg\n"
]
}
],
"source": [
"# FFmpeg 取關鍵禎 I-Frame\n",
"\n",
"import os\n",
"import cv2\n",
"import subprocess\n",
"\n",
"filename = '/home/tx2/Videos/Kevin_Car.MOV'\n",
"\n",
"def get_frame_types(video_fn):\n",
" command = 'ffprobe -v error -show_entries frame=pict_type -of default=noprint_wrappers=1'.split()\n",
" out = subprocess.check_output(command + [video_fn]).decode()\n",
" frame_types = out.replace('pict_type=','').split()\n",
" return zip(range(len(frame_types)), frame_types)\n",
"\n",
"def save_i_keyframes(video_fn):\n",
" frame_types = get_frame_types(video_fn)\n",
" i_frames = [x[0] for x in frame_types if x[1]=='I']\n",
" if i_frames:\n",
" basename = os.path.splitext(os.path.basename(video_fn))[0]\n",
" cap = cv2.VideoCapture(video_fn)\n",
" for frame_no in i_frames:\n",
" cap.set(cv2.CAP_PROP_POS_FRAMES, frame_no)\n",
" ret, frame = cap.read()\n",
" outname = basename+'_i_frame_'+str(frame_no)+'.jpg'\n",
" cv2.imwrite(outname, frame)\n",
" print ('Saved: '+outname)\n",
" cap.release()\n",
" else:\n",
" print ('No I-frames in '+video_fn)\n",
"\n",
"if __name__ == '__main__':\n",
" save_i_keyframes(filename)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "9b758f80",
"metadata": {},
"outputs": [],
"outputs": [],
"source": []
"source": []
}
}
...
...
AlprTritonClient/__pycache__/EZLPR.cpython-36.pyc
deleted
100644 → 0
View file @
9690e1f2
File deleted
AlprTritonClient/__pycache__/yolo.cpython-36.pyc
deleted
100644 → 0
View file @
9690e1f2
File deleted
AlprTritonClient/__pycache__/yolo_shared_memory.cpython-36.pyc
deleted
100644 → 0
View file @
9690e1f2
File deleted
test_camera.ipynb
View file @
dc3fe5c1
...
@@ -522,9 +522,73 @@
...
@@ -522,9 +522,73 @@
},
},
{
{
"cell_type": "code",
"cell_type": "code",
"execution_count":
null
,
"execution_count":
2
,
"id": "78266468",
"id": "78266468",
"metadata": {},
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Saved: Kevin_Car_i_frame_0.jpg\n",
"Saved: Kevin_Car_i_frame_30.jpg\n",
"Saved: Kevin_Car_i_frame_60.jpg\n",
"Saved: Kevin_Car_i_frame_90.jpg\n",
"Saved: Kevin_Car_i_frame_120.jpg\n",
"Saved: Kevin_Car_i_frame_150.jpg\n",
"Saved: Kevin_Car_i_frame_180.jpg\n",
"Saved: Kevin_Car_i_frame_210.jpg\n",
"Saved: Kevin_Car_i_frame_240.jpg\n",
"Saved: Kevin_Car_i_frame_270.jpg\n",
"Saved: Kevin_Car_i_frame_300.jpg\n",
"Saved: Kevin_Car_i_frame_330.jpg\n",
"Saved: Kevin_Car_i_frame_360.jpg\n",
"Saved: Kevin_Car_i_frame_390.jpg\n",
"Saved: Kevin_Car_i_frame_420.jpg\n",
"Saved: Kevin_Car_i_frame_450.jpg\n"
]
}
],
"source": [
"# FFmpeg 取關鍵禎 I-Frame\n",
"\n",
"import os\n",
"import cv2\n",
"import subprocess\n",
"\n",
"filename = '/home/tx2/Videos/Kevin_Car.MOV'\n",
"\n",
"def get_frame_types(video_fn):\n",
" command = 'ffprobe -v error -show_entries frame=pict_type -of default=noprint_wrappers=1'.split()\n",
" out = subprocess.check_output(command + [video_fn]).decode()\n",
" frame_types = out.replace('pict_type=','').split()\n",
" return zip(range(len(frame_types)), frame_types)\n",
"\n",
"def save_i_keyframes(video_fn):\n",
" frame_types = get_frame_types(video_fn)\n",
" i_frames = [x[0] for x in frame_types if x[1]=='I']\n",
" if i_frames:\n",
" basename = os.path.splitext(os.path.basename(video_fn))[0]\n",
" cap = cv2.VideoCapture(video_fn)\n",
" for frame_no in i_frames:\n",
" cap.set(cv2.CAP_PROP_POS_FRAMES, frame_no)\n",
" ret, frame = cap.read()\n",
" outname = basename+'_i_frame_'+str(frame_no)+'.jpg'\n",
" cv2.imwrite(outname, frame)\n",
" print ('Saved: '+outname)\n",
" cap.release()\n",
" else:\n",
" print ('No I-frames in '+video_fn)\n",
"\n",
"if __name__ == '__main__':\n",
" save_i_keyframes(filename)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "e5b68fa5",
"metadata": {},
"outputs": [],
"outputs": [],
"source": []
"source": []
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment