Package: scoutbot
Quick Links1How to Install2How to Run3How to Build and Deploy3.1Docker Hub3.2PyPI4Tests and Coverage5Building Documentation6Logging7Code Formatting1How to Installpipinstallscoutbotor, from source:gitclonehttps://github.com/WildMeOrg/scoutbotcdscoutbotpipinstall-e.To then add GPU acceleration, you need to replaceonnxruntimewithonnxruntime-gpu:pipuninstall-yonnxruntimepipinstallonnxruntime-gpu2How to RunYou can run the tile-based Gradio demo with:pythonapp.pyor, you can run the image-based Gradio demo with:pythonapp2.pyTo run with Docker:dockerrun\-it\--rm\-p7860:7860\-eCONFIG=phase1\-eWIC_BATCH_SIZE=512\--gpusall\--namescoutbot\wildme/scoutbot:main\python3app2.pyTo run with Docker Compose:version:"3"services:scoutbot:image:wildme/scoutbot:maincommand:python3 app2.pyports:-"7860:7860"environment:CONFIG:phase1WIC_BATCH_SIZE:512restart:unless-stoppeddeploy:resources:reservations:devices:-driver:nvidiadevice_ids:["all"]capabilities:[gpu]and rundocker compose up-d.3How to Build and Deploy3.1Docker HubThe application can also be built into a Docker image and is hosted on Docker Hub aswildme/scoutbot:latest.  Any time themainbranch is updated or a tagged release is made (see the PyPI instructions below), an automated GitHub CD action will build and deploy the newest image to Docker Hub automatically.To do this manually, use the code below:dockerloginexportDOCKER_BUILDKIT=1exportDOCKER_CLI_EXPERIMENTAL=enableddockerbuildxcreate--namemulti-arch-builder--usedockerbuildxbuild\-twildme/scoutbot:latest\--platformlinux/amd64\--push\.3.2PyPITo upload the latest ScoutBot version to the Python Package Index (PyPI), follow the steps below:Editscoutbot/__init__.py:65and setVERSIONto the desired versionVERSION='X.Y.Z'Push any changes and version update to themainbranch on GitHub and wait for CI tests to passgitpulloriginmaingitcommit-am"Release for Version X.Y.Z"gitpushoriginmainTag themainbranch as a new release using theSemVer pattern(e.g.,vX.Y.Z)gitpulloriginmaingittagvX.Y.ZgitpushoriginvX.Y.ZWait for the automated GitHub CD actions to build and push toPyPIandDocker Hub.4Tests and CoverageYou can run the automated tests in thetests/folder by running:pipinstall-rrequirements.optional.txtpytestYou may also get a coverage percentage by running:coveragehtmland open thecoverage/html/index.htmlfile in your browser.5Building DocumentationThere is Sphinx documentation in thedocs/folder, which can be built by running:cddocs/pipinstall-rrequirements.optional.txtsphinx-build-Mhtml.build/6LoggingThe script uses Python’s built-in logging functionality calledlogging.  All print functions are replaced withlog.info(), which sends the output to two places:the terminal window, andthe filescoutbot.log7Code FormattingIt’s recommended that you usepre-committo ensure linting procedures are run
on any code you write.  Seepre-commit.comfor more information.Referencepre-commit’s installation instructionsfor software installation on your OS/platform. After you have the software installed, runpre-commitinstallon the command line. Now every time you commit to this project’s code base the linter procedures will automatically run over the changed files.  To run pre-commit on files preemtively from the command line use:pipinstall-rrequirements.optional.txtpre-commitrun--all-filesThe code base has been formatted byBrunette, which is a fork and more configurable version ofBlack.  Furthermore, try to conform toPEP8.  You should set up your preferred editor to useflake8as its Python linter, but pre-commit will ensure compliance before a git commit is completed.  This will use theflake8configuration withinsetup.cfg, which ignores several errors and stylistic considerations.  See thesetup.cfgfile for a full and accurate listing of stylistic codes to ignore.