University of Electronic Science and Technology of China

seg

seg

Instance Segmentation

2023-02-24 1:50pm

Version 5 Generated Feb 24, 2023

Roboflow 2.1 Instance Segmentation

SAMPLES FROM TEST SET

Drop Image

OR

Paste YouTube / Image URL

Try this model on images, video, or use your webcam

0
fps
0
objects detected
                                 
Copied

How to Deploy the seg Detection API

Using Roboflow, you can deploy your object detection model to a range of environments, including:

  • Luxonis OAK
  • Raspberry Pi
  • NVIDIA Jetson
  • A Docker container
  • A web page
  • A Python script using the Roboflow SDK.

Below, we have instructions on how to use our deployment options.

Hosted API
Python
Javascript
## Infer on Local and Hosted Images To install dependencies, `pip install roboflow` ``` from roboflow import Roboflow rf = Roboflow(api_key="API_KEY") project = rf.workspace().project("MODEL_ENDPOINT") model = project.version(VERSION).model # infer on a local image print(model.predict("your_image.jpg").json()) # infer on an image hosted elsewhere print(model.predict("URL_OF_YOUR_IMAGE").json()) # save an image annotated with your predictions model.predict("your_image.jpg").save("prediction.jpg") ```
## Node.js We're using [axios](https://github.com/axios/axios) to perform the POST request in this example so first run npm install axios to install the dependency. ### Inferring on a Local Image ``` const axios = require("axios"); const fs = require("fs"); const image = fs.readFileSync("YOUR_IMAGE.jpg", { encoding: "base64" }); axios({ method: "POST", url: "https://outline.roboflow.com/MODEL_ENDPOINT/VERSION", params: { api_key: "API_KEY" }, data: image, headers: { "Content-Type": "application/x-www-form-urlencoded" } }) .then(function(response) { console.log(response.data); }) .catch(function(error) { console.log(error.message); }); ``` ### Inferring on an Image Hosted Elsewhere via URL ``` const axios = require("axios"); axios({ method: "POST", url: "https://outline.roboflow.com/MODEL_ENDPOINT/VERSION", params: { api_key: "API_KEY", image: "IMAGE_URL" } }) .then(function(response) { console.log(response.data); }) .catch(function(error) { console.log(error.message); }); ```