/** * Deprecated. Use {@link #forInputValue(ClarifaiInputValue)} instead. * @param video * @return */ @Deprecated @NotNull public static ClarifaiInput forVideo(@NotNull ClarifaiVideo video) { return forInputValue(video); }
/** * Deprecated. Use {@link #forInputValue(ClarifaiInputValue)} instead. * @param image the image to represent * @return a {@link ClarifaiInput} that represents the given image */ @Deprecated @NotNull public static ClarifaiInput forImage(@NotNull ClarifaiImage image) { return forInputValue(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)); }
/** * 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)); }
/** * 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)); }
/** * 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 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 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(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 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)); }
@NotNull private PredictRequest<Prediction> makePredictRequest() { return client.predict(client.getDefaultModels().travelModel().id()) .withInputs( ClarifaiInput.forInputValue( ClarifaiImage.of(FAMILY_IMAGE_URL) .withAllowDuplicateUrl(false))); } }
@Retry @Test public void t16b_predictWithModel_00() { assertSuccess(client.getDefaultModels().generalModel().predict() .withInputs(ClarifaiInput.forInputValue(ClarifaiImage.of(METRO_NORTH_IMAGE_URL) .withCrop(Crop.create() .top(0.1F) .bottom(0.8F) ) ))); }
@Test public void cropping() { client.addInputs() .plus( ClarifaiInput.forInputValue( ClarifaiImage.of("@@sampleTrain") .withCrop(Crop.create() .top(0.2F) .left(0.4F) .bottom(0.3F) .right(0.6F) ) ) ) .allowDuplicateURLs(true) .executeSync(); }
ClarifaiInput.forInputValue(ClarifaiImage.of("@@samplePuppy")) .withConcepts( Concept.forID("boscoe") ), ClarifaiInput.forInputValue(ClarifaiImage.of("@@sampleWedding")) .withConcepts( Concept.forID("boscoe").withValue(false)
@Retry @Test public void t01a_addInputs() throws Exception { assertSuccess(client.addInputs() .plus(ClarifaiInput.forInputValue(ClarifaiImage.of(KOTLIN_LOGO_IMAGE_FILE) .withCrop(Crop.create() .top(0.1F) .left(0.1F) .bottom(0.9F) .right(0.9F) ) ) .withID("foo1") .withConcepts(Concept.forID("concept1").withValue(false)) ) ); }