Skip to content
Snippets Groups Projects
Commit 4d4b6469 authored by Tristan Walter's avatar Tristan Walter
Browse files

pvinfo examples, and setting runtime to be quiet in pvinfo

parent f2334a30
No related branches found
No related tags found
No related merge requests found
...@@ -21,11 +21,14 @@ ENUM_CLASS(Arguments, ...@@ -21,11 +21,14 @@ ENUM_CLASS(Arguments,
ENUM_CLASS(parameter_format_t, settings, minimal) ENUM_CLASS(parameter_format_t, settings, minimal)
int main(int argc, char**argv) { int main(int argc, char**argv) {
//DEBUG::set_runtime_quiet(); DEBUG::set_runtime_quiet();
auto OS_ACTIVITY_DT_MODE = getenv("OS_ACTIVITY_DT_MODE"); auto OS_ACTIVITY_DT_MODE = getenv("OS_ACTIVITY_DT_MODE");
#ifndef NDEBUG
if(OS_ACTIVITY_DT_MODE) { if(OS_ACTIVITY_DT_MODE) {
Debug("OS_ACTIVITY_DT_MODE: %s", OS_ACTIVITY_DT_MODE); Debug("OS_ACTIVITY_DT_MODE: %s", OS_ACTIVITY_DT_MODE);
} }
#endif
//SETTING(quiet) = true; //SETTING(quiet) = true;
default_config::register_default_locations(); default_config::register_default_locations();
......
...@@ -68,10 +68,28 @@ The tracker only expects an input file:: ...@@ -68,10 +68,28 @@ The tracker only expects an input file::
Just like with |grabs|, you can attach any number of additional parameters to the command-line, simply using ``-PARAMETER VALUE`` (see :doc:`parameters_trex`). Just like with |grabs|, you can attach any number of additional parameters to the command-line, simply using ``-PARAMETER VALUE`` (see :doc:`parameters_trex`).
Tools Other command-line tools
----- ------------------------
Another tool is included, called ``pvinfo``, which can be used programmatically (e.g. in jupyter notebooks) to retrieve information about converted videos and the settings used to track them. The usual way to make use of it within python is:: Another tool is included, called ``pvinfo``, which can be used programmatically (e.g. in jupyter notebooks) to retrieve information about converted videos and the settings used to track them::
$ pvinfo -i <VIDEO> -print_parameters [analysis_range,video_size] -quiet
analysis_range = [1000,50000]
video_size = [3712,3712]
If no settings (apart from ``-i <pv-videopath>``) are provided, it displays some information on the PV file::
$ pvinfo -i group_1
[15:24:00] pv::File<V6, 182.97MB, '/Users/tristan/Videos/group_1', [3712 x 3712], 19317 frames, no mask>
crop_offsets: [0,0,0,0]
Time of recording: 'Tue Apr 28 06:42:28 2020'
Length of recording: '00d:00h:10m:03s'
Framerate: 32fps (31.25ms)
Metadata: {"meta_species": "Zebrafish", "meta_age_days": 25, "meta_conditions": "", "meta_misc": "", "cam_limit_exposure": 5500, "meta_real_width": 30, "meta_source_path": "/media/nvme/group_1.avi", "meta_cmd": " ./tgrabs -i /media/nvme/group_1.avi -s /media/nvme/convert_group_1.settings -enable_live_tracking", "meta_build": "<hash>", "meta_conversion_time": "28-04-2020 06:42:09", "frame_rate": 32}
It can be useful for retrieving values of tracking parameters from external scripts, like in python (also things like ``video_size``)::
def get_parameter(video, parameter, root = "", prefix = "", info_path = "/path/to/pvinfo"): def get_parameter(video, parameter, root = "", prefix = "", info_path = "/path/to/pvinfo"):
"""Uses the pvinfo utility to retrieve information about tracked videos. """Uses the pvinfo utility to retrieve information about tracked videos.
...@@ -129,6 +147,15 @@ Another tool is included, called ``pvinfo``, which can be used programmatically ...@@ -129,6 +147,15 @@ Another tool is included, called ``pvinfo``, which can be used programmatically
But it has many other uses, too! For example, it can be used to save heatmap information that can be visualized in |trex| (but can not currently be saved directly from |trex| -> will be soon):: But it has many other uses, too! For example, it can be used to save heatmap information that can be visualized in |trex| (but can not currently be saved directly from |trex| -> will be soon)::
pvinfo -i video -heatmap -heatmap_source SPEED -heatmap_resolution 128 -heatmap_frames 100 -heatmap_dynamic pvinfo -i video -heatmap -heatmap_source SPEED -heatmap_resolution 128 -heatmap_frames 100 -heatmap_dynamic
Or to display information about objects inside the saved frames::
$ pvinfo -i <VIDEO> -blob_detail -quiet
[15:24:07] 190315246 bytes (190.32MB) of blob data
[15:24:07] Images average at 512.654519 px / blob and the range is [2-2154] with a median of 616.
[15:24:07] There are 10 blobs in each frame (median).
Batch processing support Batch processing support
======================== ========================
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment