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
|
| 5 |
+
colorFrom: blue
|
| 6 |
+
colorTo: green
|
| 7 |
+
sdk: gradio
|
| 8 |
+
sdk_version: 3.1.4
|
| 9 |
+
app_file: app.py
|
| 10 |
+
pinned: true
|
| 11 |
+
python_version: 3.10.5
|
| 12 |
+
---
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
Wild Me Scout
|
| 16 |
+
=============
|
| 17 |
+
|
| 18 |
+
[](https://github.com/WildMeOrg/scoutbot/actions/workflows/testing.yml)
|
| 19 |
+
[](https://github.com/WildMeOrg/scoutbot/actions/workflows/python-publish.yml)
|
| 20 |
+
[](https://scoutbot.readthedocs.io/en/latest/?badge=latest)
|
| 21 |
+
[](https://huggingface.co/spaces/WildMeOrg/scoutbot)
|
| 22 |
+
|
| 23 |
+
::: {.contents backlinks="none"}
|
| 24 |
+
Quick Links
|
| 25 |
+
:::
|
| 26 |
+
|
| 27 |
+
::: {.sectnum}
|
| 28 |
+
:::
|
| 29 |
+
|
| 30 |
+
How to Install
|
| 31 |
+
--------------
|
| 32 |
+
|
| 33 |
+
You need to first install Anaconda on your machine. Below are the
|
| 34 |
+
instructions on how to install Anaconda on an Apple macOS machine, but
|
| 35 |
+
it is possible to install on a Windows and Linux machine as well.
|
| 36 |
+
Consult the [official Anaconda page](https://www.anaconda.com) to
|
| 37 |
+
download and install on other systems. For Windows computers, it is
|
| 38 |
+
highly recommended that you intall the [Windows Subsystem for
|
| 39 |
+
Linux](https://docs.microsoft.com/en-us/windows/wsl/install).
|
| 40 |
+
|
| 41 |
+
``` {.bash}
|
| 42 |
+
# Install Homebrew
|
| 43 |
+
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
|
| 44 |
+
|
| 45 |
+
# Install Anaconda and expose conda to the terminal
|
| 46 |
+
brew install anaconda
|
| 47 |
+
export PATH="/opt/homebrew/anaconda3/bin:$PATH"
|
| 48 |
+
conda init zsh
|
| 49 |
+
conda update conda
|
| 50 |
+
```
|
| 51 |
+
|
| 52 |
+
Once Anaconda is installed, you will need an environment and the
|
| 53 |
+
following packages installed
|
| 54 |
+
|
| 55 |
+
``` {.bash}
|
| 56 |
+
# Create Environment
|
| 57 |
+
conda create --name scout
|
| 58 |
+
conda activate scout
|
| 59 |
+
|
| 60 |
+
# Install Python dependencies
|
| 61 |
+
conda install pip
|
| 62 |
+
|
| 63 |
+
conda install -r requirements.txt
|
| 64 |
+
conda install pytorch torchvision -c pytorch-nightly
|
| 65 |
+
```
|
| 66 |
+
|
| 67 |
+
How to Run
|
| 68 |
+
----------
|
| 69 |
+
|
| 70 |
+
It is recommended to use [ipython]{.title-ref} and to copy sections of code
|
| 71 |
+
into and inspecting the
|
| 72 |
+
|
| 73 |
+
``` {.bash}
|
| 74 |
+
# Run the training script
|
| 75 |
+
cd scoutbot/
|
| 76 |
+
python train.py
|
| 77 |
+
|
| 78 |
+
# Run the live demo
|
| 79 |
+
python app.py
|
| 80 |
+
```
|
| 81 |
+
|
| 82 |
+
Unit Tests
|
| 83 |
+
----------
|
| 84 |
+
|
| 85 |
+
You can run the automated tests in the [tests/]{.title-ref} folder by
|
| 86 |
+
running [pytest]{.title-ref}. This will give an output of which tests
|
| 87 |
+
have failed. You may also get a coverage percentage by running [coverage
|
| 88 |
+
html]{.title-ref} and loading the [coverage/html/index.html]{.title-ref}
|
| 89 |
+
file in your browser. pytest
|
| 90 |
+
|
| 91 |
+
Building Documentation
|
| 92 |
+
----------------------
|
| 93 |
+
|
| 94 |
+
There is Sphinx documentation in the [docs/]{.title-ref} folder, which
|
| 95 |
+
can be built with the code below:
|
| 96 |
+
|
| 97 |
+
``` {.bash}
|
| 98 |
+
cd docs/
|
| 99 |
+
sphinx-build -M html . build/
|
| 100 |
+
```
|
| 101 |
+
|
| 102 |
+
Logging
|
| 103 |
+
-------
|
| 104 |
+
|
| 105 |
+
The script uses Python\'s built-in logging functionality called
|
| 106 |
+
[logging]{.title-ref}. All print functions are replaced with
|
| 107 |
+
[log.info]{.title-ref} within this script, which sends the output to two
|
| 108 |
+
places: 1) the terminal window, 2) the file [scout.log]{.title-ref}.
|
| 109 |
+
Get into the habit of writing text logs and keeping date-specific
|
| 110 |
+
versions for comparison and debugging.
|
| 111 |
+
|
| 112 |
+
Code Formatting
|
| 113 |
+
---------------
|
| 114 |
+
|
| 115 |
+
It\'s recommended that you use `pre-commit` to ensure linting procedures
|
| 116 |
+
are run on any code you write. (See also
|
| 117 |
+
[pre-commit.com](https://pre-commit.com/))
|
| 118 |
+
|
| 119 |
+
Reference [pre-commit\'s installation
|
| 120 |
+
instructions](https://pre-commit.com/#install) for software installation
|
| 121 |
+
on your OS/platform. After you have the software installed, run
|
| 122 |
+
`pre-commit install` on the command line. Now every time you commit to
|
| 123 |
+
this project\'s code base the linter procedures will automatically run
|
| 124 |
+
over the changed files. To run pre-commit on files preemtively from the
|
| 125 |
+
command line use:
|
| 126 |
+
|
| 127 |
+
``` {.bash}
|
| 128 |
+
git add .
|
| 129 |
+
pre-commit run
|
| 130 |
+
|
| 131 |
+
# or
|
| 132 |
+
|
| 133 |
+
pre-commit run --all-files
|
| 134 |
+
```
|
| 135 |
+
|
| 136 |
+
The code base has been formatted by Brunette, which is a fork and more
|
| 137 |
+
configurable version of Black
|
| 138 |
+
(<https://black.readthedocs.io/en/stable/>). Furthermore, try to conform
|
| 139 |
+
to PEP8. You should set up your preferred editor to use flake8 as its
|
| 140 |
+
Python linter, but pre-commit will ensure compliance before a git commit
|
| 141 |
+
is completed. This will use the flake8 configuration within `setup.cfg`,
|
| 142 |
+
which ignores several errors and stylistic considerations. See the
|
| 143 |
+
`setup.cfg` file for a full and accurate listing of stylistic codes to
|
| 144 |
+
ignore.
|
| 145 |
+
|