Skip to content

Commit

Permalink
fix: update python version and fix bug in vis test (TRI-ML#85)
Browse files Browse the repository at this point in the history
* fix: update python version and fix bug in vis test

* fix: updated workflows
  • Loading branch information
chrisochoatri authored Apr 22, 2022
1 parent 92c870b commit 863df96
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 12 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
env:
ENVIRONMENT: TEST_RUNNER
OS: ubuntu-18.04
PYTHON: '3.6'
PYTHON: '3.7'
COVERAGE_TOTAL: 46 # Coverage threshold percentage
steps:
- name: Checkout (admin token)
Expand All @@ -29,7 +29,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@master
with:
python-version: 3.6
python-version: 3.7
- name: Install dependencies
id: coverage-installer
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/doc-gen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ jobs:
runs-on: ubuntu-18.04
env:
OS: ubuntu-18.04
PYTHON: '3.6'
PYTHON: '3.7'
steps:
- uses: actions/checkout@master
with:
fetch-depth: ‘1’
- name: Setup Python
uses: actions/setup-python@master
with:
python-version: 3.6
python-version: 3.7
- name: Setup requirements and run sphinx
run: |
python -m pip install --upgrade pip
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pre-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ jobs:
uses: wagoid/commitlint-github-action@v4
with:
configFile: .commitlintrc.yml
- name: Install Python 3.6
- name: Install Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.6
python-version: 3.7
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM nvidia/cuda:11.1-devel-ubuntu18.04

ARG python=3.6
ARG python=3.7
ENV PYTORCH_VERSION=1.8.1+cu111
ENV TORCHVISION_VERSION=0.9.1+cu111

Expand Down
Binary file modified tests/data/dgp/vis_output.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 7 additions & 5 deletions tests/utils/test_visualization_engine.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import json
import os
import cv2

import cv2
import numpy as np
from dgp.datasets.synchronized_dataset import SynchronizedScene
from dgp.utils.visualization_engine import visualize_dataset_3d, visualize_dataset_2d, visualize_dataset_sample_3d, visualize_dataset_sample_2d

from dgp.datasets.synchronized_dataset import SynchronizedScene
from dgp.utils.visualization_engine import (
visualize_dataset_2d, visualize_dataset_3d, visualize_dataset_sample_2d, visualize_dataset_sample_3d
)
from tests import TEST_DATA_DIR


Expand Down Expand Up @@ -78,5 +80,5 @@ def test_visualize_dataset_sample_3d():
)

result = visualize_dataset_sample_3d(dataset=dataset, scene_idx=0, sample_idx=0, camera_datum_names=['camera_05'])
data = cv2.imread('tests/data/dgp/vis_output.png', cv2.IMREAD_COLOR)
assert np.allclose(result["camera_05"], data)
data = cv2.cvtColor(cv2.imread('tests/data/dgp/vis_output.png', cv2.IMREAD_COLOR), cv2.COLOR_BGR2RGB)
assert np.allclose(result['camera_05'], data, rtol=1e-3)

0 comments on commit 863df96

Please sign in to comment.