Skip to content
This repository was archived by the owner on Apr 18, 2024. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .github/workflows/build_bundle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ on:
branch_name:
required: true
type: string
ref:
required: true
type: string

env:
# increment it in case if you need to reset cache
Expand All @@ -24,7 +27,11 @@ jobs:
if: "!contains(github.event.head_commit.message, 'skip ci')"

steps:
- uses: actions/checkout@v3
- name: "Checlout codebase"
uses: actions/checkout@v3
with:
ref: ${{ inputs.ref }}

- uses: actions/setup-node@v3
with:
node-version: "${{ env.NODE }}"
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/cicd_pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ jobs:
with:
sha: ${{ github.event.pull_request.head.sha || github.event.after }}
branch_name: ${{ github.event.pull_request.head.ref || github.ref_name }}
ref: ${{ github.event.pull_request.head.ref || github.ref_name }}
secrets: inherit

run_e2e:
Expand All @@ -34,6 +35,7 @@ jobs:
with:
sha: ${{ github.event.pull_request.head.sha || github.event.after }}
branch_name: ${{ github.event.pull_request.head.ref || github.ref_name }}
ref: ${{ github.event.pull_request.head.ref || github.ref_name }}
secrets: inherit

run_unit:
Expand All @@ -43,6 +45,7 @@ jobs:
with:
sha: ${{ github.event.pull_request.head.sha || github.event.after }}
branch_name: ${{ github.event.pull_request.head.ref || github.ref_name }}
ref: ${{ github.event.pull_request.head.ref || github.ref_name }}
secrets: inherit

run_lint:
Expand All @@ -52,4 +55,5 @@ jobs:
with:
sha: ${{ github.event.pull_request.head.sha || github.event.after }}
branch_name: ${{ github.event.pull_request.head.ref || github.ref_name }}
ref: ${{ github.event.pull_request.head.ref || github.ref_name }}
secrets: inherit
9 changes: 8 additions & 1 deletion .github/workflows/e2e_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ on:
branch_name:
required: true
type: string
ref:
required: true
type: string

env:
# increment it in case if you need to reset cache
Expand All @@ -24,7 +27,11 @@ jobs:
if: "!contains(github.event.head_commit.message, 'skip ci')"

steps:
- uses: actions/checkout@v3
- name: "Checlout codebase"
uses: actions/checkout@v3
with:
ref: ${{ inputs.ref }}

- uses: actions/setup-node@v3
with:
node-version: "${{ env.NODE }}"
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/eslint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ on:
branch_name:
required: true
type: string
ref:
required: true
type: string

env:
# increment it in case if you need to reset cache
Expand All @@ -26,6 +29,8 @@ jobs:
steps:
- name: "Checlout codebase"
uses: actions/checkout@v3
with:
ref: ${{ inputs.ref }}

- name: "Setup NodeJS"
uses: actions/setup-node@v3
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ on:
branch_name:
required: true
type: string
ref:
required: true
type: string

env:
# increment it in case if you need to reset cache
Expand All @@ -26,6 +29,8 @@ jobs:
steps:
- name: "Checlout codebase"
uses: actions/checkout@v3
with:
ref: ${{ inputs.ref }}

- name: "Setup NodeJS"
uses: actions/setup-node@v3
Expand Down
3 changes: 2 additions & 1 deletion e2e/codecept.conf.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// turn on headless mode when running with HEADLESS=true environment variable
// HEADLESS=true npx codecept run
const headless = process.env.HEADLESS;
const port = process.env.LSF_PORT ?? 3000;

module.exports.config = {
timeout: 60 * 30, // Time out after 30 minutes
Expand All @@ -14,7 +15,7 @@ module.exports.config = {
// windowSize: "1200x900",
// },
Playwright: {
url: 'http://localhost:3000',
url: `http://localhost:${port}`,
show: !headless,
restart: 'context',
timeout: 60000, // Action timeout after 60 seconds
Expand Down
44 changes: 44 additions & 0 deletions examples/image_magic_wand/START.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@

# Magic Wand for Image Segmentation

![Magic Wand](/images/screenshots/image_magic_wand.png "Magic Wand")

# Install

## Linux & Ubuntu guide

Install python and virtualenv

```bash
# install python and virtualenv
apt install python3.6
pip3 install virtualenv

# setup python virtual environment
virtualenv -p python3 env3
source env3/bin/activate

# install requirements
cd backend
pip install -r requirements.txt
```

## Cross Domain Image Access

Note that if you are storing images that you'd like to apply the Magic Wand to cross-domain, such as on Google Storage Buckets, you will have to [enable CORS headers for the storage buckets to enable cross-domain pixel access](https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image) so that the Magic Wand can get the raw pixel data to threshold. By default browsers block JavaScript from accessing pixel-level image data unless the right CORS headers are set.

As an example, if you wanted to configure a Google Storage Bucket with the right headers, you might do the following:

```bash
gsutil cors set gcp_cors_config.json gs://BUCKET-NAME
```

Note that in the gcp_cors_config.json example given in this directory that we have set `origin` to `*`, which means all origins can access that data, as well as set `responseHeader` to `*`, which means all HTTP response headers can be accessed. In a real scenario you probably want to think through the security ramifications of this for your own particular Label Studio setup.

# Start

Magic Wand for image segmentation

```bash
python server.py -c config.json -l ../examples/magic_wand/config.xml -i ../examples/magic_wand/tasks.json -o output
```
Loading