Skip to content

Commit

Permalink
Add whitespace error checking to GitHub Actions (#311)
Browse files Browse the repository at this point in the history
* Fix whitespace errors

As detected with `git diff --check`.

* Add a job to check for whitespace errors

I called it "lint" so that other checks could be added to it later.

* Bump copyright years in changed files
  • Loading branch information
Roman Donchenko authored Jun 25, 2021
1 parent f53d423 commit d2073b8
Show file tree
Hide file tree
Showing 18 changed files with 60 additions and 63 deletions.
1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,3 @@ LICENSE text
*.gif binary
*.ttf binary
*.pdf binary

8 changes: 8 additions & 0 deletions .github/workflows/pr_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,11 @@ jobs:
run: |
pytest -v
datum -h
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Checking whitespace
run: |
empty_tree="$(git hash-object -t tree --stdin < /dev/null)"
git diff --check "$empty_tree"
3 changes: 1 addition & 2 deletions datumaro/components/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

# Copyright (C) 2019-2020 Intel Corporation
# Copyright (C) 2019-2021 Intel Corporation
#
# SPDX-License-Identifier: MIT

3 changes: 1 addition & 2 deletions datumaro/components/algorithms/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

# Copyright (C) 2019-2020 Intel Corporation
# Copyright (C) 2019-2021 Intel Corporation
#
# SPDX-License-Identifier: MIT

3 changes: 1 addition & 2 deletions datumaro/plugins/accuracy_checker_plugin/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Copyright (C) 2020 Intel Corporation
# Copyright (C) 2020-2021 Intel Corporation
#
# SPDX-License-Identifier: MIT

Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,3 @@ def import_prediction(pred):
# -
else:
raise NotImplementedError("Can't convert %s" % type(pred))




18 changes: 9 additions & 9 deletions datumaro/plugins/openvino_plugin/README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# OpenVINO™ Inference Interpreter
# OpenVINO™ Inference Interpreter
Interpreter samples to parse OpenVINO™ inference outputs.

## Models supported from interpreter samples
There are detection and image classification examples.
There are detection and image classification examples.

- Detection (SSD-based)
- Intel Pre-trained Models > Object Detection
- Intel Pre-trained Models > Object Detection
- [face-detection-0200](https://docs.openvinotoolkit.org/latest/omz_models_intel_face_detection_0200_description_face_detection_0200.html)
- [face-detection-0202](https://docs.openvinotoolkit.org/latest/omz_models_intel_face_detection_0202_description_face_detection_0202.html)
- [face-detection-0204](https://docs.openvinotoolkit.org/latest/omz_models_intel_face_detection_0204_description_face_detection_0204.html)
- [person-detection-0200](https://docs.openvinotoolkit.org/latest/omz_models_intel_person_detection_0200_description_person_detection_0200.html)
- [person-detection-0201](https://docs.openvinotoolkit.org/latest/omz_models_intel_person_detection_0201_description_person_detection_0201.html)
- [person-detection-0202](https://docs.openvinotoolkit.org/latest/omz_models_intel_person_detection_0202_description_person_detection_0202.html)
- [person-detection-0202](https://docs.openvinotoolkit.org/latest/omz_models_intel_person_detection_0202_description_person_detection_0202.html)
- [person-vehicle-bike-detection-2000](https://docs.openvinotoolkit.org/latest/omz_models_intel_person_vehicle_bike_detection_2000_description_person_vehicle_bike_detection_2000.html)
- [person-vehicle-bike-detection-2001](https://docs.openvinotoolkit.org/latest/omz_models_intel_person_vehicle_bike_detection_2001_description_person_vehicle_bike_detection_2001.html)
- [person-vehicle-bike-detection-2002](https://docs.openvinotoolkit.org/latest/omz_models_intel_person_vehicle_bike_detection_2002_description_person_vehicle_bike_detection_2002.html)
Expand All @@ -28,7 +28,7 @@ There are detection and image classification examples.
- [mobilenet-v2-pytorch](https://docs.openvinotoolkit.org/latest/omz_models_public_mobilenet_v2_pytorch_mobilenet_v2_pytorch.html)

You can find more OpenVINO™ Trained Models [here](https://docs.openvinotoolkit.org/latest/omz_models_intel_index.html)
To run the inference with OpenVINO™, the model format should be Intermediate Representation(IR).
To run the inference with OpenVINO™, the model format should be Intermediate Representation(IR).
For the Caffe/TensorFlow/MXNet/Kaldi/ONNX models, please see the [Model Conversion Instruction](https://docs.openvinotoolkit.org/latest/openvino_docs_MO_DG_prepare_model_convert_model_Converting_Model.html)

You need to implement your own interpreter samples to support the other OpenVINO™ Trained Models.
Expand All @@ -49,12 +49,12 @@ You need to implement your own interpreter samples to support the other OpenVINO
```

## Model inference
- Prerequisites:
- Prerequisites:
- OpenVINO™ (To install OpenVINO™, please see the [OpenVINO™ Installation Instruction](https://docs.openvinotoolkit.org/latest/openvino_docs_install_guides_installing_openvino_linux.html))
- Datumaro (To install Datumaro, please see the [User Manual](docs/user_manual.md))
- OpenVINO™ models (To download OpenVINO™ models, please see the [Model Downloader Instruction](https://docs.openvinotoolkit.org/latest/omz_tools_downloader_README.html))
- PASCAL VOC 2012 dataset (To download VOC 2012 dataset, please go [VOC2012 download](http://host.robots.ox.ac.uk/pascal/VOC/voc2012/#devkit))

- To run the inference with OpenVINO™ models and the interpreter samples, please follow the instructions below.

```bash
Expand All @@ -76,7 +76,7 @@ You need to implement your own interpreter samples to support the other OpenVINO
-i samples/ssd_mobilenet_coco_detection_interp.py
datum add path -p proj_ssd_mobilenet_v2_coco_detection -f voc VOCdevkit/
datum model run -p proj_ssd_mobilenet_v2_coco_detection -m model-0
# Classification> mobilenet-v2-pytorch
source /opt/intel/openvino/bin/setupvars.sh
cd datumaro/plugins/openvino_plugin
Expand Down
3 changes: 1 addition & 2 deletions datumaro/plugins/openvino_plugin/launcher.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

# Copyright (C) 2019-2020 Intel Corporation
# Copyright (C) 2019-2021 Intel Corporation
#
# SPDX-License-Identifier: MIT

Expand Down Expand Up @@ -195,4 +195,3 @@ def categories(self):

def process_outputs(self, inputs, outputs):
return self._interpreter.process_outputs(inputs, outputs)

Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ def process_outputs(inputs, outputs):
w = min(int(det[5] * input_width - x), input_width)
h = min(int(det[6] * input_height - y), input_height)

image_results.append(Bbox(x, y, w, h, label=label,
image_results.append(Bbox(x, y, w, h, label=label,
attributes={ 'score': conf, 'scores': list(map(float, det_confs)) }
))

results.append(image_results)

return results
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ def process_outputs(inputs, outputs):
w = min(int(det[5] * input_width - x), input_width)
h = min(int(det[6] * input_height - y), input_height)

image_results.append(Bbox(x, y, w, h, label=label,
image_results.append(Bbox(x, y, w, h, label=label,
attributes={ 'score': conf, 'scores': list(map(float, det_confs)) }
))

results.append(image_results)

return results
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ def process_outputs(inputs, outputs):
w = min(int(det[5] * input_width - x), input_width)
h = min(int(det[6] * input_height - y), input_height)

image_results.append(Bbox(x, y, w, h, label=label,
image_results.append(Bbox(x, y, w, h, label=label,
attributes={ 'score': conf, 'scores': list(map(float, det_confs)) }
))

results.append(image_results)

return results
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ def process_outputs(inputs, outputs):
w = min(int(det[5] * input_width - x), input_width)
h = min(int(det[6] * input_height - y), input_height)

image_results.append(Bbox(x, y, w, h, label=label,
image_results.append(Bbox(x, y, w, h, label=label,
attributes={ 'score': conf, 'scores': list(map(float, det_confs)) }
))

results.append(image_results)

return results
Expand Down
2 changes: 1 addition & 1 deletion docs/formats/coco_user_manual.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ datum import --format coco_stuff --input-path <path/to/stuff.json>
Datumaro supports the following COCO tasks:
- [Image Captioning](https://cocodataset.org/#captions-2015) (`coco_caption`)
- [Object Detection](https://cocodataset.org/#detection-2020) (`coco_instances`)
- Image classification (our extension) (`coco_labels`) - a format like Object Detection, which uses
- Image classification (our extension) (`coco_labels`) - a format like Object Detection, which uses
only `category_id` and `score` annotation fields
- [Panoptic Segmentation](https://cocodataset.org/#panoptic-2020) (`coco_panoptic`)
- [Keypoint Detection](https://cocodataset.org/#keypoints-2020) (`coco_person_keypoints`)
Expand Down
8 changes: 4 additions & 4 deletions docs/formats/mnist_user_manual.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ MNIST dataset directory should have the following structure:
```
└─ Dataset/
├── labels.txt # list of non-digit labels (optional)
├── t10k-images-idx3-ubyte.gz
├── t10k-labels-idx1-ubyte.gz
├── train-images-idx3-ubyte.gz
├── t10k-images-idx3-ubyte.gz
├── t10k-labels-idx1-ubyte.gz
├── train-images-idx3-ubyte.gz
└── train-labels-idx1-ubyte.gz
```
MNIST in CSV dataset directory should have the following structure:
Expand All @@ -75,7 +75,7 @@ MNIST in CSV dataset directory should have the following structure:
```
└─ Dataset/
├── labels.txt # list of non-digit labels (optional)
├── mnist_test.csv
├── mnist_test.csv
└── mnist_train.csv
```
If the dataset needs non-digit labels, you need to add the labels.txt
Expand Down
1 change: 0 additions & 1 deletion tests/assets/lfw_dataset/test/pairs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@
name1 1 2
name0 1 name1 1
name0 1 name1 2

41 changes: 20 additions & 21 deletions tests/assets/tf_detection_api_dataset/label_map.pbtxt
Original file line number Diff line number Diff line change
@@ -1,50 +1,49 @@
item {
id: 1
name: 'label_0'
id: 1
name: 'label_0'
}

item {
id: 2
name: 'label_1'
id: 2
name: 'label_1'
}

item {
id: 3
name: 'label_2'
id: 3
name: 'label_2'
}

item {
id: 4
name: 'label_3'
id: 4
name: 'label_3'
}

item {
id: 5
name: 'label_4'
id: 5
name: 'label_4'
}

item {
id: 6
name: 'label_5'
id: 6
name: 'label_5'
}

item {
id: 7
name: 'label_6'
id: 7
name: 'label_6'
}

item {
id: 8
name: 'label_7'
id: 8
name: 'label_7'
}

item {
id: 9
name: 'label_8'
id: 9
name: 'label_8'
}

item {
id: 10
name: 'label_9'
id: 10
name: 'label_9'
}

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
0--Parade/0_Parade_image_01.jpg
1
1 2 2 2 0 0 0 0 0 0
1 2 2 2 0 0 0 0 0 0
1--Handshaking/1_Handshaking_image_02.jpg
2
1 1 2 2 0 0 1 0 0 0
5 1 2 2 0 0 1 0 0 0
1 1 2 2 0 0 1 0 0 0
5 1 2 2 0 0 1 0 0 0
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
0--Parade/0_Parade_image_03.jpg
3
0 0 1 1 2 0 0 0 2 0
3 2 1 2 0 0 0 1 0 0
5 6 1 1 2 0 0 0 2 0
0 0 1 1 2 0 0 0 2 0
3 2 1 2 0 0 0 1 0 0
5 6 1 1 2 0 0 0 2 0

0 comments on commit d2073b8

Please sign in to comment.