public class ModelUtils
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
IMAGE_FORMAT_JPG |
static java.lang.String |
IMAGE_FORMAT_PNG |
static int |
POSE_LEFT_ANKLE_INDEX |
static int |
POSE_LEFT_EAR_INDEX |
static int |
POSE_LEFT_ELBOW_INDEX |
static int |
POSE_LEFT_EYE_INDEX |
static int |
POSE_LEFT_HIP_INDEX |
static int |
POSE_LEFT_KNEE_INDEX |
static int |
POSE_LEFT_SHOULDER_INDEX |
static int |
POSE_LEFT_WRIST_INDEX |
static int |
POSE_NOSE_INDEX |
static int |
POSE_RIGHT_ANKLE_INDEX |
static int |
POSE_RIGHT_EAR_INDEX |
static int |
POSE_RIGHT_ELBOW_INDEX |
static int |
POSE_RIGHT_EYE_INDEX |
static int |
POSE_RIGHT_HIP_INDEX |
static int |
POSE_RIGHT_KNEE_INDEX |
static int |
POSE_RIGHT_SHOULDER_INDEX |
static int |
POSE_RIGHT_WRIST_INDEX |
Constructor and Description |
---|
ModelUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
drawPoseParts(JSONObject data,
PGraphics g,
float ellipseSize)
Traverses Pose Net poses and keypoints and draws ellipses for each keypoint position
|
static PImage |
fromBase64(java.lang.String runwayImageString)
converts a Base64 encoded String to a PImage
|
static java.lang.String |
toBase64(PImage image)
converts a PImage to a Base64 encoded String
|
static java.lang.String |
toBase64(PImage image,
java.lang.String format)
converts a PImage to a Base64 encoded String
|
static java.lang.String |
toRunwayImageQuery(PImage image)
convert a PImage to a JSONObject with the Base64 encoded image as the value of the "image" key
|
static java.lang.String |
toRunwayImageQuery(PImage image,
java.lang.String format)
convert a PImage to a JSONObject with the Base64 encoded image as the value of the "image" key
|
static java.lang.String |
toRunwayImageQuery(PImage image,
java.lang.String format,
java.lang.String key)
convert a PImage to a JSONObject with the Base64 encoded image as the value of the "image" key
|
public static int POSE_NOSE_INDEX
public static int POSE_LEFT_EYE_INDEX
public static int POSE_RIGHT_EYE_INDEX
public static int POSE_LEFT_EAR_INDEX
public static int POSE_RIGHT_EAR_INDEX
public static int POSE_LEFT_SHOULDER_INDEX
public static int POSE_RIGHT_SHOULDER_INDEX
public static int POSE_LEFT_ELBOW_INDEX
public static int POSE_RIGHT_ELBOW_INDEX
public static int POSE_LEFT_WRIST_INDEX
public static int POSE_RIGHT_WRIST_INDEX
public static int POSE_LEFT_HIP_INDEX
public static int POSE_RIGHT_HIP_INDEX
public static int POSE_LEFT_KNEE_INDEX
public static int POSE_RIGHT_KNEE_INDEX
public static int POSE_LEFT_ANKLE_INDEX
public static int POSE_RIGHT_ANKLE_INDEX
public static java.lang.String IMAGE_FORMAT_JPG
public static java.lang.String IMAGE_FORMAT_PNG
public static void drawPoseParts(JSONObject data, PGraphics g, float ellipseSize)
data
- - the Runway Pose JSON objectg
- - the PGraphics instance to draw intoellipseSize
- - dimensions in pixels of each keypoint position ellipse diameterpublic static java.lang.String toRunwayImageQuery(PImage image)
image
- - the PImage to convert to Base64public static java.lang.String toRunwayImageQuery(PImage image, java.lang.String format)
image
- - the PImage to convert to Base64format
- - the image format: ModelUtils.IMAGE_FORMAT_JPG("JPG") or
ModelUtils.IMAGE_FORMAT_PNG("PNG")
public static java.lang.String toRunwayImageQuery(PImage image, java.lang.String format, java.lang.String key)
image
- - the PImage to convert to Base64format
- - the image format: ModelUtils.IMAGE_FORMAT_JPG("JPG") or
ModelUtils.IMAGE_FORMAT_PNG("PNG")
key
- - the JSON key for the Base64 imagepublic static java.lang.String toBase64(PImage image)
image
- - PImage to converttoBase64(PImage image,String format))
public static java.lang.String toBase64(PImage image, java.lang.String format)
image
- - PImage to convertformat
- - the image format: ModelUtils.IMAGE_FORMAT_JPG("JPG") or
ModelUtils.IMAGE_FORMAT_PNG("PNG")
public static PImage fromBase64(java.lang.String runwayImageString)
runwayImageString
- - the Base64 encoded image String from RunwayMLProcessing Library RunwayML by George Profenza. (c) 2019