Skip to content

Runs Segformer model on either whole file or with bounding box

Notifications You must be signed in to change notification settings

datatorch/segformer

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Segformer Action

Use Segformer to get semantic segmentations

Open Issues

Deploys Segformer by NVIDIA Research as a DataTorch action. Currently used for internal evaluation only.

Quick Start

name: Segformer

triggers:
  # Adds a button to the annotator.
  annotatorButton:
    name: "DEXTR"
    icon: brain
    flow: whole-file
  # flow: 2-points

jobs:
  predict:
    # Properties about the trigger event can be accessed at 'event' property
    steps:
      - name: Download File
        action: datatorch/download-file@v1
        inputs:
          # Get the file id for the event that triggered this.
          fileId: ${{ event.fileId }}
          name: ${{ event.fileName }}

      - name: Predict Segmentation
        action: aoxolotl/segformer_action@betterAPI
        inputs:
          # Download file path from the previous action.
          imagePath: ${{ variable.path }}

          # Get the file id from action input
          fileId: ${{ event.fileId }}
          # Get the 4 points the user clicked
          # points: ${{ event.flowData.points }}

          # Annotation created by the four points. We will insert the
          # segmentation into this annotation
          annotationId: ${{ event.annotationId }}

NOTE: Running Segformer for the first time will take serval minutes to complete as it needs to download the Segformer docker image. Do not exit out of your agent unless it specifically throws an error.

Action

Inputs

Name Type Default Description
imagePath string required Absolute path to image. This path must be in the agent directory.
points array required 4 points marking the most left, right, bottom and top points of the shape.
url string http://localhost:3445 Url for sending requests. A Segformer docker image will be spun up on this port if not found.
image string add3000/segformer_server Docker image to spin up.
annotationId string null Annotation to insert segmentation into. If not provided the segmentation will not be inserted.
simplify float 1.5 Simplification tolerance applied to segmentation before importing. Set to 0 to disable. Disabling can significantly increase pipeline performance, but decrease annotator performance.

Outputs

Name Type Description
segmentation array Segmentation of points predicted by Segformer

About

Runs Segformer model on either whole file or with bounding box

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%