Class OrcaSpotWorkerExe2

java.lang.Object
rawDeepLearningClassifier.dlClassification.orcaSpot.OrcaSpotWorkerExe2

public class OrcaSpotWorkerExe2 extends Object
Executes the Orca Spot deep learning classifier from a python.exe file and python scripts.

A temporary wav file is written from current audio data. Python code is then executed which reads the python.exe file and runs scripts which us a deep learning model to detect whether there is an Orca in the audio data. A result is then returned.

This a clunky way of doing this however serves as a prototype for a more integrated approach in future.

Prerequisites

  • The OrcaSpot folder with required scripts and models. Script paths are located in OrcaSpotParmas
  • Python and Anaconda or similar installed.
  • Cuda installed from Nvidea.
  • Cuda support for Pytorch installed.
  • To set up the python environment properly
    • Open command prompt or Anaconda prompt if is using Anaconda.
    • Type python -m venv C:\Your\Enviroment\Path\Here for Example python -m venv C:\Users\Hauec\Desktop\Segmenter\pytorch\my-venv. This creates a Folder called my-venv in the PyTorch Folder inside of the Segmenter.
    • Next you need to activate your Virtual environment. Inside of my-venv\Scripts should see a windows batch called activate.bat. cd to it and run it in CMD. You'll know that it is active via the (my-venv) precommand.
    • Once that is done, run setup_pytorch.bat from the PyTorch folder. It should automatically install Pytorch, PyVision, and all of the required dependencies. With the exception of pywin32 and pypiwin32. Both of them need to installed manually through pip. e.g. pip install pywin32, pypiwin32

To get the daemon to run properly you must also install C:\Users\macst>conda install win32pipe e.g. in Anaconda this is:

  • conda install win32pipe, win32file, pywintypes
  • Author:
    Christopher Hauer, Jamie Macaulay