Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
ht-jo authored and ht-jo committed Jan 5, 2023
2 parents 8aa61e4 + d65ad93 commit cc6e88a
Show file tree
Hide file tree
Showing 425 changed files with 21,838 additions and 7,785 deletions.
15 changes: 0 additions & 15 deletions .dockerignore

This file was deleted.

26 changes: 26 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"ignorePatterns": [ "**/*.js" ],
"root": true,
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint"
],
"extends": ["eslint:recommended", "plugin:@typescript-eslint/eslint-recommended", "plugin:@typescript-eslint/recommended"],
"rules": {
"linebreak-style": 0,
"comma-dangle": ["error", "always-multiline"],
"no-plusplus": "off",
"func-names": 0,
"import/no-unresolved": 0,
"import/extensions": 0,
"import/no-extraneous-dependencies": 0,
"no-underscore-dangle": 0,
"no-nested-ternary": 0,
"no-async-promise-executor": 0,
"radix": 0
},
"env": {
"es6": true,
"node": true
}
}
40 changes: 40 additions & 0 deletions .github/workflows/Disabled/dockerhub.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Publish image to DockerHub

on:
push:
branches: [ "master" ]
paths:
- "cc/**"
- "install/**"
- "lib/**"
- "typings/**"
- "package.json"
- ".github/workflows/dockerhub.yml"

jobs:
buildx:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
-
name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
-
name: Available platforms
run: echo ${{ steps.buildx.outputs.platforms }}
-
name: Build the Docker image
run: docker buildx build -f Dockerfile-debian --platform linux/amd64,linux/arm64 -t urielch/opencv-nodejs:latest -t urielch/opencv-nodejs:$(date +%Y-%m-%d_%H%M%S) --push .

45 changes: 45 additions & 0 deletions .github/workflows/build-apt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Node.js CI using prebuilt openCV

on:
push:
branches: [ "master" ]
paths:
- "cc/**"
- "install/**"
- "lib/**"
- "test/**"
- "typings/**"
- "package.json"
- ".github/workflows/build-apt.yml"

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- name: Install opencv pkg
run: sudo apt-get install -y build-essential libopencv-contrib-dev libopencv-dev
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 7.3.0
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- run: pnpm install --frozen-lockfile
env:
OPENCV4NODEJS_DISABLE_AUTOBUILD: 1
- run: pnpm run prepack
# - run: npm run build --if-present
# - run: npx build-opencv rebuild
# - run: npm test
56 changes: 56 additions & 0 deletions .github/workflows/full-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Build all from source

on:
# push:
# branches: [ "master" ]
# pull_request:
# branches: [ "master" ]
workflow_dispatch:
# Inputs the workflow accepts.
inputs:
name:
description: 'build all from source'
default: '4.7.0'
required: true

env:
SOLUTION_FILE_PATH: .
BUILD_CONFIGURATION: Release
OPENCV_BUILD_ROOT: D:/opencv

permissions:
contents: read

jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 7.3.0
- uses: actions/setup-node@v3
with:
node-version: 18
cache: 'pnpm'

- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v1.1.3

- name: run pnpm install
run: pnpm install --frozen-lockfile

- name: pnpm run prepack
run: pnpm run prepack

- name: install deps in test
working-directory: ./test
run: pnpm install --frozen-lockfile

- name: build OpenCV
working-directory: ./test
run: pnpm build-opencv --version ${{ github.event.inputs.name }} rebuild

- name: run test-appveyor test
working-directory: ./test
run: pnpm run test-appveyor
38 changes: 38 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages

name: publish on npmjs

on:
release:
types: [created]
workflow_dispatch:

env:
OPENCV_INCLUDE_DIR: /usr/include/opencv4/
OPENCV_LIB_DIR: /usr/lib/x86_64-linux-gnu/
OPENCV_BIN_DIR: /usr/bin/
OPENCV4NODEJS_DISABLE_AUTOBUILD: 1

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Install libopencv
run: sudo apt-get install -y libopencv-dev libopencv-features2d-dev
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 7.3.0
- uses: actions/setup-node@v3
with:
node-version: 16
registry-url: https://registry.npmjs.org/
cache: 'pnpm'
- run: pnpm install --frozen-lockfile
- run: pnpm run prepack
- run: cd test && pnpm install --frozen-lockfile
- run: cd test && pnpm run test
- run: pnpm publish --no-git-checks
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
93 changes: 93 additions & 0 deletions .github/workflows/prebuild.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
name: Build using prebuild openCV

on:
push:
branches: [ "master" ]
paths:
- "cc/**"
- "install/**"
- "lib/**"
- "test/**"
- "typings/**"
- "package.json"
- ".github/workflows/prebuild.yml"
pull_request:
branches: [ "master" ]
paths:
- "cc/**"
- "install/**"
- "lib/**"
- "test/**"
- "typings/**"
- "package.json"
- ".github/workflows/prebuild.yml"

env:
# Path to the solution file relative to the root of the project.
SOLUTION_FILE_PATH: .
# define common env value no more needed since V 6.2.2
# OPENCV_INCLUDE_DIR: c:\tools\opencv\build\include
# OPENCV_LIB_DIR: c:\tools\opencv\build\x64\vc14\lib
# OPENCV_BIN_DIR: c:\tools\opencv\build\x64\vc14\bin
OPENCV4NODEJS_DISABLE_AUTOBUILD: 1
# Configuration type to build.
# You can convert this to a build matrix if you need coverage of multiple configuration types.
# https://docs.github.com/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
BUILD_CONFIGURATION: Release

permissions:
contents: read

jobs:
build:
runs-on: windows-latest
strategy:
matrix:
opencv_version:
# - 4.7.0 not available yet
- 4.6.0
# - 4.5.5 # 2019-12-23 ubuntu 22.04
# - 4.2.0 # 2019-12-23 ubuntu 20.04
# - 3.4.16
node_version:
# - 16
- 18
architecture:
- x64
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 7.3.0
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node_version }}
architecture: ${{ matrix.architecture }}
cache: 'pnpm'

- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v1.0.2

- name: Install OpenCV
run: |
choco install OpenCV -y --version ${{ matrix.opencv_version }}
- name: add path to PATH environment variable
uses: myci-actions/export-env-var-powershell@1
with:
name: PATH
value: $env:PATH;$env:OPENCV_BIN_DIR

- name: run pnpm install
run: pnpm install --frozen-lockfile

- name: pnpm run prepack
run: pnpm run prepack

- name: install deps in test
working-directory: ./test
run: pnpm install --frozen-lockfile

- name: run test-appveyor test
working-directory: ./test
run: pnpm run test-appveyor
43 changes: 42 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ vs
.vs
.vscode
build
bin
node_modules
crash.log
coverage
Expand All @@ -13,3 +12,45 @@ data/dnn
dist
.DS_Store
native-node-utils
*/**.js.map
examples/typed/*.js
examples/typed/faceDetect/*.js
examples/typed/dnn/*.js
examples/*.js.map
examples/*.js
data/ocr/lcletters.xml
data/ocr/confusionmatrix.csv
examples/faceDetect/*.js
examples/dnn/*.js
examples/**/*.d.ts
install/*.d.ts
lib/**/*.d.ts
data/text-models/frozen_east_text_detection.pb
data/face/lbfmodel.yaml
bin/win32-x64-82/opencv4nodejs.node
test/**/*.js
examples/**/*.js
examples/src/ObjectDetection-YOLO/bird_yolo_out.jpg
examples/src/yolov3.weights
examples/src/ObjectDetection-YOLO/yolo_out_py.avi
examples/src/AgeGender/age-gender-out-sample1.jpg
examples/src/AgeGender/gender_net.caffemodel
examples/src/AgeGender/opencv_face_detector_uint8.pb
examples/src/AgeGender/age_net.caffemodel
.pnpm-debug.log
examples/data/dnn/yolo-object-detection/
lib/src/*.map
lib/src/*.js
examples/src/JPEGImages/
examples/labels/
examples/*.txt
examples/src/YOLOv3-Training-Snowman-Detector/JPEGImages/
examples/src/YOLOv3-Training-Snowman-Detector/labels/
examples/src/YOLOv3-Training-Snowman-Detector/*.txt
examples/src/YOLOv3-Training-Snowman-Detector/*.csv
examples/src/YOLOv3-Training-Snowman-Detector/darknet.data
examples/src/YOLOv3-Training-Snowman-Detector/classes.names
examples/src/YOLOv3-Training-Snowman-Detector/train.log
examples/src/YOLOv3-Training-Snowman-Detector/darknet53.conv.74
examples/src/YOLOv3-Training-Snowman-Detector/weights
docs/
Loading

0 comments on commit cc6e88a

Please sign in to comment.