Skip to content
This repository was archived by the owner on Oct 25, 2021. It is now read-only.

Commit 1560475

Browse files
committed
Merge branch 'master' of github.com:catalyst-team/segmentation into instance_pipeline
2 parents cfec7c3 + 8ad810e commit 1560475

File tree

16 files changed

+125
-214
lines changed

16 files changed

+125
-214
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
hooks:
33
- id: yapf
44
name: yapf
5-
entry: bash ./bin/yapf.sh --all-in-place
5+
entry: bash ./bin/_yapf.sh --all-in-place
66
language: system
77
files: \.py$
88
require_serial: true

.travis.yml

Lines changed: 0 additions & 51 deletions
This file was deleted.

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ check-style:
66
codestyle:
77
pre-commit run
88

9-
docker-build: ./requirements/requirements-docker.txt
10-
docker build -t catalyst-segmentation:latest . -f docker/Dockerfile
9+
docker: ./requirements/
10+
docker build -t catalyst-segmentation:latest . -f ./docker/Dockerfile
1111

1212
clean:
1313
rm -rf build/

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
**Accelerated DL & RL**
66

7-
[![Build Status](http://66.248.205.49:8111/app/rest/builds/buildType:id:Catalyst_Deploy/statusIcon.svg)](http://66.248.205.49:8111/project.html?projectId=Catalyst&tab=projectOverview&guest=1)
7+
[![Build Status](http://66.248.205.49:8111/app/rest/builds/buildType:id:Segmentation_Tests/statusIcon.svg)](http://66.248.205.49:8111/project.html?projectId=Segmentation&tab=projectOverview&guest=1)
88
[![Pipi version](https://img.shields.io/pypi/v/catalyst.svg)](https://pypi.org/project/catalyst/)
99
[![Docs](https://img.shields.io/badge/dynamic/json.svg?label=docs&url=https%3A%2F%2Fpypi.org%2Fpypi%2Fcatalyst%2Fjson&query=%24.info.version&colorB=brightgreen&prefix=v)](https://catalyst-team.github.io/catalyst/index.html)
1010
[![PyPI Status](https://pepy.tech/badge/catalyst)](https://pepy.tech/project/catalyst)
@@ -29,7 +29,7 @@ Part of [PyTorch Ecosystem](https://pytorch.org/ecosystem/). Part of [Catalyst E
2929

3030
---
3131

32-
# Catalyst.Segmentation [![Build Status](https://travis-ci.com/catalyst-team/segmentation.svg?branch=master)](https://travis-ci.com/catalyst-team/segmentation) [![Github contributors](https://img.shields.io/github/contributors/catalyst-team/segmentation.svg?logo=github&logoColor=white)](https://github.com/catalyst-team/segmentation/graphs/contributors)
32+
# Catalyst.Segmentation [![Build Status](http://66.248.205.49:8111/app/rest/builds/buildType:id:Segmentation_Tests/statusIcon.svg)](http://66.248.205.49:8111/project.html?projectId=Segmentation&tab=projectOverview&guest=1) [![Github contributors](https://img.shields.io/github/contributors/catalyst-team/segmentation.svg?logo=github&logoColor=white)](https://github.com/catalyst-team/segmentation/graphs/contributors)
3333

3434
You will learn how to build image segmentation pipeline with transfer learning using the Catalyst framework.
3535

bin/_check_codestyle.sh

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,41 @@
11
#!/usr/bin/env bash
2-
set -e
2+
3+
# Cause the script to exit if a single command fails
4+
set -eo pipefail -v
35

46
# Parse -s flag which tells us that we should skip inplace yapf
7+
echo 'parse -s flag'
58
skip_inplace=""
69
while getopts ":s" flag; do
710
case "${flag}" in
811
s) skip_inplace="true" ;;
912
esac
1013
done
1114

15+
echo 'isort: `isort -rc --check-only --settings-path ./setup.cfg`'
16+
isort -rc --check-only --settings-path ./setup.cfg
1217

1318
# stop the build if there are any unexpected flake8 issues
14-
bash ./bin/flake8.sh --count \
19+
echo 'flake8: `bash ./bin/_flake8.sh`'
20+
bash ./bin/_flake8.sh --count \
1521
--config=./setup.cfg \
16-
--show-source --statistics
22+
--show-source \
23+
--statistics
1724

1825
# exit-zero treats all errors as warnings.
19-
flake8 . --count --exit-zero \
20-
--max-complexity=10 \
26+
echo 'flake8 (warnings): `flake8 .`'
27+
flake8 ./bin/_flake8.sh --count \
2128
--config=./setup.cfg \
22-
--statistics
29+
--max-complexity=10 \
30+
--show-source \
31+
--statistics \
32+
--exit-zero
2333

2434
# test to make sure the code is yapf compliant
2535
if [[ -f ${skip_inplace} ]]; then
26-
bash ./bin/yapf.sh --all
36+
echo 'yapf: `bash ./bin/_yapf.sh --all`'
37+
bash ./bin/_yapf.sh --all
2738
else
28-
bash ./bin/yapf.sh --all-in-place
39+
echo 'yapf: `bash ./bin/_yapf.sh --all-in-place`'
40+
bash ./bin/_yapf.sh --all-in-place
2941
fi

bin/_flake8.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/env bash
2+
3+
# Cause the script to exit if a single command fails
4+
set -eo pipefail -v
5+
6+
# this stops git rev-parse from failing if we run this from the .git directory
7+
builtin cd "$(dirname "${BASH_SOURCE:-$0}")"
8+
9+
ROOT="$(git rev-parse --show-toplevel)"
10+
builtin cd "$ROOT" || exit 1
11+
12+
13+
flake8 "$@"

bin/_yapf.sh

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#!/usr/bin/env bash
2+
3+
# Cause the script to exit if a single command fails
4+
set -eo pipefail -v
5+
6+
# this stops git rev-parse from failing if we run this from the .git directory
7+
builtin cd "$(dirname "${BASH_SOURCE:-$0}")"
8+
9+
ROOT="$(git rev-parse --show-toplevel)"
10+
builtin cd "$ROOT" || exit 1
11+
12+
13+
YAPF_FLAGS=(
14+
'--style' "$ROOT/setup.cfg"
15+
'--recursive'
16+
'--parallel'
17+
)
18+
19+
YAPF_EXCLUDES=(
20+
'--exclude' 'docker/*'
21+
)
22+
23+
# Format specified files
24+
format() {
25+
yapf --in-place "${YAPF_FLAGS[@]}" -- "$@"
26+
}
27+
28+
# Format all files, and print the diff to stdout for travis.
29+
format_all() {
30+
yapf --diff "${YAPF_FLAGS[@]}" "${YAPF_EXCLUDES[@]}" ./**/*.py
31+
}
32+
33+
format_all_in_place() {
34+
yapf --in-place "${YAPF_FLAGS[@]}" "${YAPF_EXCLUDES[@]}" ./**/*.py
35+
}
36+
37+
# This flag formats individual files. --files *must* be the first command line
38+
# arg to use this option.
39+
if [[ "$1" == '--files' ]]; then
40+
format "${@:2}"
41+
# If `--all` is passed, then any further arguments are ignored and the
42+
# entire python directory is formatted.
43+
elif [[ "$1" == '--all' ]]; then
44+
format_all
45+
elif [[ "$1" == '--all-in-place' ]]; then
46+
format_all_in_place
47+
else
48+
# Format only the files that changed in last commit.
49+
exit 1
50+
fi

bin/flake8.sh

Lines changed: 0 additions & 45 deletions
This file was deleted.

bin/tests/_check_binary.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ print(aggregated_loss)
3535
print(iou_soft)
3636
print(iou_hard)
3737
38-
assert aggregated_loss < 1.3
39-
assert iou_soft > 0.30
38+
assert aggregated_loss < 1.4
39+
assert iou_soft > 0.25
4040
assert iou_hard > 0.25
4141
"""

bin/yapf.sh

Lines changed: 0 additions & 96 deletions
This file was deleted.

0 commit comments

Comments
 (0)