-
Prerequisites: python3, pip, virtualenv
-
Prepare the virtual environment:
virtualenv local_env
source local_env/bin/activate
- Install requirements (~1.1 GB)
pip install -r requirements.txt
requirements.txt includes the latest tensorflow library, which has many dependencies, hence the size. Following is a full list of dependencies that will be installed:
numpy, opencv-python, six, grpcio, google-pasta, astunparse, pyasn1, pyasn1-modules, rsa, cachetools, google-auth, chardet, certifi, idna, urllib3, requests, oauthlib, requests-oauthlib, google-auth-oauthlib, absl-py, protobuf, tensorboard-plugin-wit, werkzeug, zipp, importlib-metadata, markdown, tensorboard, h5py, keras-preprocessing, tensorflow-estimator, opt-einsum, gast, wrapt, termcolor, tensorflow
-
Download weights for a pre-trained neural network (~20 MB) and extract them from the archive.
-
Create a file "local.conf" in the project root directory and copy contents of "sample.config" to it.
-
Update the value of "model_path" in local.conf to the path where neural network weights were extracted.
-
Run single image test script and check that it is executed without errors:
python single_image_test.py
The image with detected boats will be saved in a file "local_output.jpg". Check it out!
- Update the value of "camera_stream_path" in local.conf. It can be equal to:
- an integer camera index (eg 0 for built-in laptop camera);
- video file path (if loading from);
- network stream URL;
- etc. check OpenCV documentation for more source options.
- Run
python main.py