bluemellophone commited on
Commit
73da713
·
unverified ·
1 Parent(s): 3431579

Updated CI/CD, Codecov, and Docker image

Browse files
.codecov.yml ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ codecov:
2
+ require_ci_to_pass: yes
3
+
4
+ coverage:
5
+ status:
6
+ project:
7
+ default:
8
+ threshold: 1%
9
+ patch:
10
+ default:
11
+ target: 50%
12
+ range: "50...90"
13
+ round: down
14
+ precision: 1
15
+
16
+ parsers:
17
+ gcov:
18
+ branch_detection:
19
+ conditional: yes
20
+ loop: yes
21
+ method: no
22
+ macro: no
23
+
24
+ comment:
25
+ layout: "reach,diff,flags,files,footer"
26
+ behavior: default
27
+ require_changes: no
.dockerignore ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ examples/0d4e4df2-7b69-91b1-1985-c8421f2f3253.jpg
2
+ examples/18cef191-74ed-2b5e-55a5-f58bd3d483ff.jpg
3
+ examples/1be4d40a-6fd0-42ce-da6c-294e45781f41.jpg
4
+ examples/1d3c85e9-ee24-f290-e7e1-6e338f2eaebb.jpg
5
+ examples/3e043302-af1c-75a7-4057-3a2f25c123bf.jpg
6
+ examples/43ecc08d-502a-7a51-9d68-3e40a76439a2.jpg
7
+ examples/479058af-e774-e6aa-a2b0-9a42dd6ff8b1.jpg
8
+ examples/7c910b87-ae3a-f580-d431-03cd89793803.jpg
9
+ examples/8fa04489-cd94-7d8f-7e2e-5f0fe2f7ae76.jpg
10
+ examples/bb7b4345-b98a-c727-4c94-6090f0aa4355.jpg
11
+
12
+ docs/
13
+ tests/
14
+
15
+ .DS_Store
16
+
17
+ *.egg-info/
18
+
19
+ .coverage
20
+ coverage/
21
+
22
+ gradio_cached_examples/
23
+ __pycache__/
24
+ docs/build/
25
+
26
+ requirements.optional.txt
27
+
28
+ scoutbot/loc/models/pytorch
29
+ scoutbot/loc/models/onnx/scout.loc.5fbfff26.1.onnx
30
+ scoutbot/wic/models/pytorch
31
+ scoutbot/wic/models/onnx/scout.wic.5fbfff26.3.2.onnx
32
+ scoutbot/wic/models/onnx/scout.wic.5fbfff26.3.1.onnx
.github/workflows/python-publish.yml CHANGED
@@ -63,7 +63,7 @@ jobs:
63
  needs: [build_wheels, build_sdist]
64
  runs-on: ubuntu-latest
65
  # upload to PyPI on every tag starting with 'v'
66
- if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
67
  steps:
68
  - uses: actions/download-artifact@v2
69
  with:
 
63
  needs: [build_wheels, build_sdist]
64
  runs-on: ubuntu-latest
65
  # upload to PyPI on every tag starting with 'v'
66
+ if: github.event_name == 'push' # && startsWith(github.event.ref, 'refs/tags/v')
67
  steps:
68
  - uses: actions/download-artifact@v2
69
  with:
.github/workflows/testing.yml CHANGED
@@ -49,13 +49,11 @@ jobs:
49
  - name: Run coverage
50
  run: |
51
  coverage xml html
52
- env:
53
- LOG_WIDTH: 120
54
 
55
  - name: Upload coverage to Codecov
56
  uses: codecov/codecov-action@v1.2.1
57
  with:
58
  token: ${{ secrets.CODECOV_TOKEN }}
59
- files: ./_coverage/coverage.xml
60
  env_vars: OS,PYTHON
61
  fail_ci_if_error: true
 
49
  - name: Run coverage
50
  run: |
51
  coverage xml html
 
 
52
 
53
  - name: Upload coverage to Codecov
54
  uses: codecov/codecov-action@v1.2.1
55
  with:
56
  token: ${{ secrets.CODECOV_TOKEN }}
57
+ files: ./coverage/coverage.xml
58
  env_vars: OS,PYTHON
59
  fail_ci_if_error: true
Dockerfile CHANGED
@@ -1,14 +1,23 @@
1
- FROM continuumio/anaconda3:latest
2
 
3
  ENV GRADIO_SERVER_NAME=0.0.0.0
4
 
5
  ENV GRADIO_SERVER_PORT=7860
6
 
 
 
 
 
 
 
 
 
 
7
  WORKDIR /code
8
 
9
  COPY ./ /code
10
 
11
- RUN conda install pip \
12
- && pip install --no-cache-dir -r requirements.txt
13
 
14
- CMD python app.py
 
1
+ FROM nvidia/cuda:11.7.1-cudnn8-runtime-ubuntu20.04
2
 
3
  ENV GRADIO_SERVER_NAME=0.0.0.0
4
 
5
  ENV GRADIO_SERVER_PORT=7860
6
 
7
+ # Install apt packages
8
+ RUN set -ex \
9
+ && apt-get update \
10
+ && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
11
+ python3-dev \
12
+ python3-pip \
13
+ && rm -rf /var/cache/apt \
14
+ && rm -rf /var/lib/apt/lists/*
15
+
16
  WORKDIR /code
17
 
18
  COPY ./ /code
19
 
20
+ RUN pip3 install --no-cache-dir -r requirements.txt \
21
+ && pip3 install -e .
22
 
23
+ CMD python3 app.py
README.rst CHANGED
@@ -56,14 +56,17 @@ The application can also be built into a Docker image and hosted on Docker Hub.
56
 
57
  .. code:: bash
58
 
 
 
 
 
59
  export DOCKER_BUILDKIT=1
60
  export DOCKER_CLI_EXPERIMENTAL=enabled
61
-
62
  docker buildx create --name multi-arch-builder --use
63
 
64
  docker buildx build \
65
  -t wildme/scoutbot:latest \
66
- --platform linux/amd64,linux/arm64 \
67
  --push \
68
  .
69
 
 
56
 
57
  .. code:: bash
58
 
59
+ # linux/amd64
60
+
61
+ docker login
62
+
63
  export DOCKER_BUILDKIT=1
64
  export DOCKER_CLI_EXPERIMENTAL=enabled
 
65
  docker buildx create --name multi-arch-builder --use
66
 
67
  docker buildx build \
68
  -t wildme/scoutbot:latest \
69
+ --platform linux/arm64 \
70
  --push \
71
  .
72
 
requirements.txt CHANGED
@@ -3,7 +3,7 @@ cryptography
3
  gradio
4
  imgaug
5
  numpy
6
- onnxruntime
7
  opencv-python-headless
8
  Pillow
9
  rich
 
3
  gradio
4
  imgaug
5
  numpy
6
+ onnxruntime-gpu
7
  opencv-python-headless
8
  Pillow
9
  rich
scoutbot/loc/__init__.py CHANGED
@@ -63,7 +63,9 @@ def pre(inputs):
63
 
64
 
65
  def predict(data, fill=True):
66
- ort_session = ort.InferenceSession(ONNX_MODEL, providers=['CPUExecutionProvider'])
 
 
67
 
68
  preds = []
69
  for chunk in ut.ichunks(data, BATCH_SIZE):
 
63
 
64
 
65
  def predict(data, fill=True):
66
+ ort_session = ort.InferenceSession(
67
+ ONNX_MODEL, providers=['CUDAExecutionProvider', 'CPUExecutionProvider']
68
+ )
69
 
70
  preds = []
71
  for chunk in ut.ichunks(data, BATCH_SIZE):
scoutbot/wic/__init__.py CHANGED
@@ -38,7 +38,9 @@ def pre(inputs):
38
 
39
 
40
  def predict(data, fill=False):
41
- ort_session = ort.InferenceSession(ONNX_MODEL, providers=['CPUExecutionProvider'])
 
 
42
 
43
  preds = []
44
  for chunk in ut.ichunks(data, BATCH_SIZE):
 
38
 
39
 
40
  def predict(data, fill=False):
41
+ ort_session = ort.InferenceSession(
42
+ ONNX_MODEL, providers=['CUDAExecutionProvider', 'CPUExecutionProvider']
43
+ )
44
 
45
  preds = []
46
  for chunk in ut.ichunks(data, BATCH_SIZE):