|
1 | | -"""Camera QC |
| 1 | +"""Video quality control. |
| 2 | +
|
2 | 3 | This module runs a list of quality control metrics on the camera and extracted video data. |
3 | 4 |
|
4 | | -Example - Run right camera QC, downloading all but video file |
5 | | - qc = CameraQC(eid, 'right', download_data=True, stream=True) |
6 | | - qc.run() |
| 5 | +Examples |
| 6 | +-------- |
| 7 | +Run right camera QC, downloading all but video file |
| 8 | +
|
| 9 | +>>> qc = CameraQC(eid, 'right', download_data=True, stream=True) |
| 10 | +>>> qc.run() |
| 11 | +
|
| 12 | +Run left camera QC with session path, update QC field in Alyx |
| 13 | +
|
| 14 | +>>> qc = CameraQC(session_path, 'left') |
| 15 | +>>> outcome, extended = qc.run(update=True) # Returns outcome of videoQC only |
| 16 | +>>> print(f'video QC = {outcome}; overall session QC = {qc.outcome}') # NB difference outcomes |
| 17 | +
|
| 18 | +Run only video QC (no timestamp/alignment checks) on 20 frames for the body camera |
| 19 | +
|
| 20 | +>>> qc = CameraQC(eid, 'body', n_samples=20) |
| 21 | +>>> qc.load_video_data() # Quicker than loading all data |
| 22 | +>>> qc.run() |
7 | 23 |
|
8 | | -Example - Run left camera QC with session path, update QC field in Alyx |
9 | | - qc = CameraQC(session_path, 'left') |
10 | | - outcome, extended = qc.run(update=True) # Returns outcome of videoQC only |
11 | | - print(f'video QC = {outcome}; overall session QC = {qc.outcome}') # NB difference outcomes |
| 24 | +Run specific video QC check and display the plots |
12 | 25 |
|
13 | | -Example - Run only video QC (no timestamp/alignment checks) on 20 frames for the body camera |
14 | | - qc = CameraQC(eid, 'body', n_samples=20) |
15 | | - qc.load_video_data() # Quicker than loading all data |
16 | | - qc.run() |
| 26 | +>>> qc = CameraQC(eid, 'left') |
| 27 | +>>> qc.load_data(download_data=True) |
| 28 | +>>> qc.check_position(display=True) # NB: Not all checks make plots |
17 | 29 |
|
18 | | -Example - Run specific video QC check and display the plots |
19 | | - qc = CameraQC(eid, 'left;) |
20 | | - qc.load_data(download_data=True) |
21 | | - qc.check_position(display=True) # NB: Not all checks make plots |
| 30 | +Run the QC for all cameras |
22 | 31 |
|
23 | | -Example - Run the QC for all cameras |
24 | | - qcs = run_all_qc(eid) |
25 | | - qcs['left'].metrics # Dict of checks and outcomes for left camera |
| 32 | +>>> qcs = run_all_qc(eid) |
| 33 | +>>> qcs['left'].metrics # Dict of checks and outcomes for left camera |
26 | 34 | """ |
27 | 35 | import logging |
28 | 36 | from inspect import getmembers, isfunction |
|
0 commit comments