diff --git a/conda/meta.yaml b/conda/meta.yaml index 3d4c54292645bce3836b63f2484c19a14223a320..d53928ce48fd4b5c1df5c85b0eed7a9442fe7b12 100644 --- a/conda/meta.yaml +++ b/conda/meta.yaml @@ -4,7 +4,7 @@ package: source: git_url: https://github.com/mooch443/trex.git - git_rev: 0912f97b8d8f4417d05dcec73ac23818ac66961f + git_rev: 14ef0fd7f95bad81c4c8131c84c54a1894adbc4f git_depth: 1 build: diff --git a/docs/install.rst b/docs/install.rst index 3a2518949e4136e1c5475cabe25bf03317393e9c..a8e159d219f3ec5a9c691234333f62156225763d 100644 --- a/docs/install.rst +++ b/docs/install.rst @@ -66,21 +66,17 @@ First, make sure that you fulfill the platform-specific requirements: As well as the general requirements: -* **Python**: We use version ``3.6.7``. +* **Python**: We use version ``>= 3.6``. * **CMake**: Version ``>= 3.16``. .. NOTE:: - We will be using Anaconda here. However, it is not *required* to use Anaconda when compiling |trex| -- it is just a straight-forward way to obtain all required dependencies. In case you do not want to use Anaconda, please make sure that all mentioned dependencies are installed in a way that can be detected by CMake. You may also add necessary paths to the CMake command-line, such as ``-DOpenCV_DIR=/path/to/opencv`` and use switches to compile certain libraries (such as OpenCV) statically with |trex|. + We will be using Anaconda here. However, it is not *required* to use Anaconda when compiling |trex| -- it is just a straight-forward way to obtain dependencies. In case you do not want to use Anaconda, please make sure that all mentioned dependencies are installed in a way that can be detected by CMake. You may also add necessary paths to the CMake command-line, such as ``-DOpenCV_DIR=/path/to/opencv`` and use switches to compile certain libraries (such as OpenCV) statically with |trex|. The easiest way to ensure that all requirements are met, is by using conda to create a new environment:: - conda create -n tracking cmake ffmpeg tensorflow=1 keras py-opencv - -under Linux, you may have to add the ``gtk2`` package as well. + conda create -n tracking cmake ffmpeg tensorflow=1.13 keras=2.3 opencv If your GPU is supported by TensorFlow, you can modify the above line by appending ``-gpu`` to ``tensorflow`` to get ``tensorflow-gpu=1.13``. - -Notice that we are omitting some runtime dependencies here, which will be added at the end of this section. If we (for example) install OpenCV for python *now*, then we might run into issues -- especially on Windows -- since the custom OpenCV version might interfere destructively with the existing version. Next, switch to the conda environment using:: @@ -93,69 +89,11 @@ You can now clone the repository and change your directory to a build folder:: mkdir build cd build -Now we have to generate the project files for the given platform and compiler. The following CMake command varies slightly depending on the operating system. Within the environment, go to the ``FishTracker/Application/build`` repository (created previously) and execute either the prepared compile scripts for your platform (on a Unix system ``../trex_build_unix.sh``, or on Windows ``../trex_build_windows.bat``) or execute cmake yourself with custom settings: - -* **Windows**:: - - cmake .. -DPYTHON_INCLUDE_DIR:FILEPATH=$(python -c "from distutils.sysconfig import get_python_inc; print(get_python_inc())") ` - -DPYTHON_LIBRARY:FILEPATH=$(python ../find_library.py) ` - -DPYTHON_EXECUTABLE:FILEPATH=$(Get-Command python | Select-Object -ExpandProperty Definition) ` - -DCMAKE_BUILD_TYPE=Release ` - -DTREX_BUILD_OPENCV=ON ` - -DTREX_BUILD_GLFW=ON ` - -DWITH_FFMPEG=ON ` - -DCMAKE_PREFIX_PATH=$CONDA_PREFIX - -* **Linux**:: - - CC=/usr/bin/gcc CXX=/usr/bin/g++ PKG_CONFIG_PATH=$CONDA_PREFIX/lib/pkgconfig \ - cmake .. -DPYTHON_INCLUDE_DIR:FILEPATH=$(python3 -c "from distutils.sysconfig import get_python_inc; print(get_python_inc())") \ - -DPYTHON_LIBRARY:FILEPATH=$(python3 ../find_library.py) \ - -DPYTHON_EXECUTABLE:FILEPATH=$(which python3) \ - -DCMAKE_BUILD_TYPE=Release \ - -DTREX_BUILD_OPENCV=ON \ - -DTREX_BUILD_GLFW=ON \ - -DWITH_FFMPEG=ON \ - -DCMAKE_PREFIX_PATH=$CONDA_PREFIX - -.. NOTE:: - Under Linux, you might also have to install the OpenGL library, and further Xorg dependencies. For example:: - - conda install -c conda-forge xorg-libxinerama xorg-libxcursor \ - xorg-libxi xorg-libxrandr xorg-libxdamage libxxf86vm-cos6-x86_64 \ - libselinux-cos6-x86_64 mesa-dri-drivers-cos6-x86_64 - -* **macOS**:: - - PKG_CONFIG_PATH=$CONDA_PREFIX/lib/pkgconfig \ - cmake .. -DPYTHON_INCLUDE_DIR:FILEPATH=$(python3 -c "from distutils.sysconfig import get_python_inc; print(get_python_inc())") \ - -DPYTHON_LIBRARY:FILEPATH=$(python3 ../find_library.py) \ - -DPYTHON_EXECUTABLE:FILEPATH=$(which python3) \ - -DCMAKE_BUILD_TYPE=Release \ - -G Xcode \ - -DTREX_BUILD_OPENCV=ON \ - -DTREX_BUILD_GLFW=ON \ - -DWITH_FFMPEG=ON \ - -DCMAKE_PREFIX_PATH=$CONDA_PREFIX \ - -DPYTHON3_PACKAGES_PATH=$(python3 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())") - -The CMake list offers a couple of options, with which you can decide to either compile libraries on your own or use existing ones in your system/environment path -- see next section. - -Now that your project files are set-up, execute these commands in order (for Unix systems):: - - cmake --build . --target CustomOpenCV --config Release \ - && cmake .. \ - && cmake --build . --config Release - -or on Windows, and in PowerShell:: +Now we have to generate the project files for the given platform and compiler. The required CMake command varies slightly depending on the operating system. Within the environment, go to the ``FishTracker/Application/build`` repository (created in the previous step) and execute the compile script for your platform (on a Unix system ``../trex_build_unix.sh``, or on Windows ``../trex_build_windows.bat``) or execute cmake yourself with custom settings (have a look at the compile script for your platform for inspiration). You can also modify them, and add switches to the cmake commands. - cmake --build . --target CustomOpenCV --config Release ` - -and cmake .. ` - -and cmake --build . --config Release - -To be able to run |trex|, you will need to install additional python dependencies, which have been omitted previously to avoid linking to the wrong libraries:: +Regarding switches, TRex offers a couple of additional options, with which you can decide to either compile libraries on your own or use existing ones in your system/environment path -- see next section. - conda install -c conda-forge matplotlib pillow opencv +The compile scripts will attempt to compile the software in Release mode. To compile in a different mode, simply run ``cmake --build . --config mode``. If compilation succeeds, you should now be able to run |trex| and |grabs| from the command-line, within the environment selected during compilation. Special needs ============= diff --git a/docs/run.rst b/docs/run.rst index 2bf60ee691bfcb76e653efa6d9a99979d15ba9f3..73c317e4c29ecab5f57fdd6edd71aba88fa0aea3 100644 --- a/docs/run.rst +++ b/docs/run.rst @@ -44,6 +44,10 @@ Running |grabs| usually involves the following parameters:: **Additional** can be any number of parameters -- be it for tracking or image processing. A full reference of available parameters for |grabs| can be found at :doc:`parameters_tgrabs`. +If multiple files match the **pattern**, then they will be concatenated into one long video. This can be useful for videos that have been split into many small parts, or just a convenient way of e.g. training visual identification on multiple videos of the same individuals. + +If there are ``[XXXXX].npz`` files (named exactly like the video files but with a different extension) in the video folder, then |grabs| will attempt to use them for frame-timestamps. + Running TRex ------------ @@ -58,6 +62,14 @@ Just like with |grabs|, you can attach any number of additional parameters to th Batch processing support ======================== +|trex| and |grabs| both offer full batch processing support. All parameters that can be setup via the settings box (and even some that are read-only when the program is already started), can be appended to the command-line -- as mentioned above. For batch processing, special parameters are available:: + + auto_quit # automatically saves all requested data to the output folder and quits the app + auto_train # automatically attempts to train the visual identification if successfully tracked + auto_apply # automatically attempts to load weights from a previous training and auto correct the video + auto_no_results # do not save a .results file + auto_no_tracking_data # do not save the data/file_fishX.npz files + auto_no_memory_stats # (enabled by default) do not save memory statistics Frequently asked questions and solutions to weird problems