public InputOuterClass.Input serialize() { return serialize(false); }
/** * @param geo a geographic coordinate to assign to this input * @return a copy of this {@link ClarifaiInput} with its geographic coordinate set to the specified value */ @NotNull public final ClarifaiInput withGeo(@Nullable PointF geo) { return new AutoValue_ClarifaiInput(id(), createdAt(), inputValue(), metadata(), concepts(), geo, regions()); }
/** * This is just a convenience function. * It's equivalent to {@code ClarifaiInput.forInputValue(ClarifaiImage.of(imageFile))}. * @param imageFile the image to represent * @return a {@link ClarifaiInput} that represents the given image */ @NotNull public static ClarifaiInput forImage(@NotNull File imageFile) { return ClarifaiInput.forInputValue(ClarifaiImage.of(imageFile)); }
/** * @param metadata the metadata to attach to this input * @return a copy of this {@link ClarifaiInput} with its metadata set to the specified value */ @NotNull public final ClarifaiInput withMetadata(@NotNull JsonObject metadata) { InternalUtil.assertMetadataHasNoNulls(metadata); return new AutoValue_ClarifaiInput(id(), createdAt(), inputValue(), metadata, concepts(), geo(), regions()); }
public static ClarifaiInputsStatus deserialize(InputOuterClass.InputCount inputCount) { return new AutoValue_ClarifaiInputsStatus.Builder() .processed(inputCount.getProcessed()) .toProcess(inputCount.getToProcess()) .errors(inputCount.getErrors()) .processing(inputCount.getProcessing()) .build(); } }
public static ClarifaiFileImage deserializeInner(ImageOuterClass.Image imageResponse) { ClarifaiFileImage image = ClarifaiImage.of(imageResponse.getBase64().toByteArray()); if (!imageResponse.getCropList().isEmpty()) { image.withCrop(Crop.deserialize(imageResponse.getCropList())); } return image; }
/** * This is just a convenience function. * It's equivalent to {@code forInputValue(ClarifaiVideo.of(videoURL))}. * @param videoURL the video to represent * @return a {@link ClarifaiInput} that represents the given video */ @NotNull public static ClarifaiInput forVideo(@NotNull String videoURL) { return forInputValue(ClarifaiVideo.of(videoURL)); }
@NotNull public static ClarifaiURLImage deserializeInner(ImageOuterClass.Image imageResponse) { ClarifaiURLImage image = ClarifaiURLImage.of(imageResponse.getUrl()); if (imageResponse.getCropCount() > 0) { image.withCrop(Crop.deserialize(imageResponse.getCropList())); } return image; }
@NotNull public static ClarifaiURLVideo of(@NotNull URL videoURL) { return new AutoValue_ClarifaiURLVideo(Crop.create(), videoURL); }
@NotNull public static ClarifaiFileVideo of(@NotNull byte[] videoBytes) { return new AutoValue_ClarifaiFileVideo(Crop.create(), videoBytes); }
@NotNull public static ClarifaiFileImage of(@NotNull byte[] imageBytes) { return new AutoValue_ClarifaiFileImage(Crop.create(), imageBytes); }
@NotNull public static ClarifaiURLImage of(@NotNull URL imageURL) { return new AutoValue_ClarifaiURLImage(Crop.create(), imageURL); }
public static ClarifaiVideo deserialize(VideoOuterClass.Video video) { return !video.getUrl().equals("") ? ClarifaiURLVideo.deserializeInner(video) : ClarifaiFileVideo.deserializeInner(video); }
public static SearchHit deserialize(Search.Hit hit) { return new AutoValue_SearchHit( hit.getScore(), ClarifaiInput.deserialize(hit.getInput()) ); } }
/** * This is just a convenience function. * It's equivalent to {@code ClarifaiInput.forInputValue(ClarifaiImage.of(imageURL))}. * @param imageURL the image to represent * @return a {@link ClarifaiInput} that represents the given image */ @NotNull public static ClarifaiInput forImage(@NotNull URL imageURL) { return ClarifaiInput.forInputValue(ClarifaiImage.of(imageURL)); }
/** * This is just a convenience function. * It's equivalent to {@code forInputValue(ClarifaiVideo.of(videoBytes))}. * @param videoBytes the video to represent * @return a {@link ClarifaiInput} that represents the given video */ @NotNull public static ClarifaiInput forVideo(@NotNull byte[] videoBytes) { return forInputValue(ClarifaiVideo.of(videoBytes)); }
/** * This is just a convenience function. * It's equivalent to {@code ClarifaiInput.forInputValue(ClarifaiImage.of(imageBytes))}. * @param imageBytes the image to represent * @return a {@link ClarifaiInput} that represents the given image */ @NotNull public static ClarifaiInput forImage(@NotNull byte[] imageBytes) { return ClarifaiInput.forInputValue(ClarifaiImage.of(imageBytes)); }
/** * This is just a convenience function. * It's equivalent to {@code forInputValue(ClarifaiVideo.of(videoFile))}. * @param videoFile the video to represent * @return a {@link ClarifaiInput} that represents the given video */ @NotNull public static ClarifaiInput forVideo(@NotNull File videoFile) { return forInputValue(ClarifaiVideo.of(videoFile)); }
/** * This is just a convenience function. * It's equivalent to {@code ClarifaiInput.forInputValue(ClarifaiImage.of(imageURL))}. * @param imageURL the image to represent * @return a {@link ClarifaiInput} that represents the given image */ @NotNull public static ClarifaiInput forImage(@NotNull String imageURL) { return ClarifaiInput.forInputValue(ClarifaiImage.of(imageURL)); }
/** * This is just a convenience function. * It's equivalent to {@code forInputValue(ClarifaiVideo.of(videoURL))}. * @param videoURL the video to represent * @return a {@link ClarifaiInput} that represents the given video */ @NotNull public static ClarifaiInput forVideo(@NotNull URL videoURL) { return forInputValue(ClarifaiVideo.of(videoURL)); }