Skip to content

Commit

Permalink
Merge branch 'develop' into az/import_export_tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikita Manovich authored Apr 20, 2021
2 parents b4b0564 + e45018b commit 11a8bc9
Show file tree
Hide file tree
Showing 14 changed files with 643 additions and 6 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/hadolint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Linter
on: pull_request
jobs:
HadoLint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Run checks
env:
HADOLINT: "${{ github.workspace }}/hadolint"
HADOLINT_VER: "2.1.0"
VERIFICATION_LEVEL: "error"
run: |
URL="https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/files"
PR_FILES=$(curl -s -X GET -G $URL | jq -r '.[] | select(.status != "removed") | .filename')
for file in $PR_FILES; do
if [[ ${file} =~ 'Dockerfile' ]]; then
changed_dockerfiles+=" ${file}"
fi
done
if [[ ! -z ${changed_dockerfiles} ]]; then
curl -sL -o ${HADOLINT} "https://github.com/hadolint/hadolint/releases/download/v${HADOLINT_VER}/hadolint-Linux-x86_64" && chmod 700 ${HADOLINT}
echo "HadoLint version: "`${HADOLINT} --version`
echo "The files will be checked: "`echo ${changed_dockerfiles}`
mkdir -p hadolint_report
${HADOLINT} --no-fail --format json ${changed_dockerfiles} > ./hadolint_report/hadolint_report.json
get_verification_level=`cat ./hadolint_report/hadolint_report.json | jq -r '.[] | .level'`
for line in ${get_verification_level}; do
if [[ ${line} =~ ${VERIFICATION_LEVEL} ]]; then
pip install json2html
python ./tests/json_to_html.py ./hadolint_report/hadolint_report.json
exit 1
else
exit 0
fi
done
else
echo "No files with the \"Dockerfile*\" name found"
fi
- name: Upload artifacts
if: failure()
uses: actions/upload-artifact@v2
with:
name: hadolint_report
path: hadolint_report
46 changes: 46 additions & 0 deletions .github/workflows/remark.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Linter
on: pull_request
jobs:
Remark:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 12

- name: Run checks
run: |
URL="https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/files"
PR_FILES=$(curl -s -X GET -G $URL | jq -r '.[] | select(.status != "removed") | .filename')
for files in $PR_FILES; do
extension="${files##*.}"
if [[ $extension == 'md' ]]; then
changed_files_remark+=" ${files}"
fi
done
if [[ ! -z ${changed_files_remark} ]]; then
npm ci
npm install remark-cli vfile-reporter-json
mkdir -p remark_report
echo "Remark version: "`npx remark --version`
echo "The files will be checked: "`echo ${changed_files_remark}`
npx remark --report json --no-stdout ${changed_files_remark} 2> ./remark_report/remark_report.json
get_report=`cat ./remark_report/remark_report.json | jq -r '.[]'`
if [[ ! -z ${get_report} ]]; then
pip install json2html
python ./tests/json_to_html.py ./remark_report/remark_report.json
exit 1
fi
else
echo "No files with the \"md\" extension found"
fi
- name: Upload artifacts
if: failure()
uses: actions/upload-artifact@v2
with:
name: remark_report
path: remark_report
42 changes: 42 additions & 0 deletions .github/workflows/stylelint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Linter
on: pull_request
jobs:
StyleLint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 12

- name: Run checks
run: |
URL="https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/files"
PR_FILES=$(curl -s -X GET -G $URL | jq -r '.[] | select(.status != "removed") | .filename')
for files in $PR_FILES; do
extension="${files##*.}"
if [[ $extension == 'css' || $extension == 'scss' ]]; then
changed_files_stylelint+=" ${files}"
fi
done
if [[ ! -z ${changed_files_stylelint} ]]; then
npm ci
mkdir -p stylelint_report
echo "StyleLint version: "`npx stylelint --version`
echo "The files will be checked: "`echo ${changed_files_stylelint}`
npx stylelint --formatter json --output-file ./stylelint_report/stylelint_report.json ${changed_files_stylelint} || exit_code=`echo $?` || true
pip install json2html
python ./tests/json_to_html.py ./stylelint_report/stylelint_report.json
exit ${exit_code}
else
echo "No files with the \"css|scss\" extension found"
fi
- name: Upload artifacts
if: failure()
uses: actions/upload-artifact@v2
with:
name: stylelint_report
path: stylelint_report
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Documentation on mask annotation (<https://github.com/openvinotoolkit/cvat/pull/3044>)
- Hotkeys to switch a label of existing object or to change default label (for objects created with N) (<https://github.com/openvinotoolkit/cvat/pull/3070>)
- A script to convert some kinds of DICOM files to regular images (<https://github.com/openvinotoolkit/cvat/pull/3095>)

### Changed

Expand All @@ -28,6 +29,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Export of instance masks with holes (<https://github.com/openvinotoolkit/cvat/pull/3044>)
- Changing a label on canvas does not work when 'Show object details' enabled (<https://github.com/openvinotoolkit/cvat/pull/3084>)
- Make sure frame unzip web worker correctly terminates after unzipping all images in a requested chunk (<https://github.com/openvinotoolkit/cvat/pull/3096>)

### Security

Expand Down
2 changes: 1 addition & 1 deletion cvat-core/src/frames.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@
if (nextChunkNumber * chunkSize < this.stopFrame) {
provider.setReadyToLoading(nextChunkNumber);
const nextStart = nextChunkNumber * chunkSize;
const nextStop = (nextChunkNumber + 1) * chunkSize - 1;
const nextStop = Math.min(this.stopFrame, (nextChunkNumber + 1) * chunkSize - 1);
if (!provider.isChunkCached(nextStart, nextStop)) {
if (!frameDataCache[this.tid].activeChunkRequest) {
frameDataCache[this.tid].activeChunkRequest = {
Expand Down
7 changes: 4 additions & 3 deletions cvat/apps/dataset_manager/bindings.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,8 +435,9 @@ def db_task(self):
def _get_filename(path):
return osp.splitext(path)[0]

def match_frame(self, path, root_hint=None):
path = self._get_filename(path)
def match_frame(self, path, root_hint=None, path_has_ext=True):
if path_has_ext:
path = self._get_filename(path)
match = self._frame_mapping.get(path)
if not match and root_hint and not path.startswith(root_hint):
path = osp.join(root_hint, path)
Expand Down Expand Up @@ -611,7 +612,7 @@ def match_dm_item(item, task_data, root_hint=None):
if frame_number is None and item.has_image:
frame_number = task_data.match_frame(item.id + item.image.ext, root_hint)
if frame_number is None:
frame_number = task_data.match_frame(item.id, root_hint)
frame_number = task_data.match_frame(item.id, root_hint, path_has_ext=False)
if frame_number is None:
frame_number = cast(item.attributes.get('frame', item.id), int)
if frame_number is None and is_video:
Expand Down
5 changes: 3 additions & 2 deletions cvat/apps/dataset_manager/formats/cvat.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,8 +441,9 @@ def load(file_object, annotations):
elif el.tag == 'image':
image_is_opened = True
frame_id = annotations.abs_frame_id(match_dm_item(
DatasetItem(id=el.attrib['name'],
attributes={'frame': el.attrib['id']}
DatasetItem(id=osp.splitext(el.attrib['name'])[0],
attributes={'frame': el.attrib['id']},
image=el.attrib['name']
),
task_data=annotations
))
Expand Down
Loading

0 comments on commit 11a8bc9

Please sign in to comment.