Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,12 @@ class Type {
return Class("TFloat32", "org.tensorflow.types");
case DataType::DT_DOUBLE:
return Class("TFloat64", "org.tensorflow.types");
case DataType::DT_HALF:
return Class("TFloat16", "org.tensorflow.types");
case DataType::DT_BFLOAT16:
return Class("TBfloat16", "org.tensorflow.types");
case DataType::DT_UINT8:
return Class("TUInt8", "org.tensorflow.types");
return Class("TUint8", "org.tensorflow.types");
case DataType::DT_INT32:
return Class("TInt32", "org.tensorflow.types");
case DataType::DT_INT64:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
import org.tensorflow.types.TInt32;
import org.tensorflow.types.TInt64;
import org.tensorflow.types.TString;
import org.tensorflow.types.TUInt8;
import org.tensorflow.types.TUint8;
import org.tensorflow.types.family.TNumber;
import org.tensorflow.types.family.TType;

Expand Down Expand Up @@ -184,6 +184,18 @@ public <T extends TNumber> RandomCrop<T> randomCrop(Operand<T> image, Operand<TI
return RandomCrop.create(scope, image, size, options);
}

/**
* Builds an {@link DecodePng} operation
*
* @param contents 0-D. The PNG-encoded image.
* @param options carries optional attributes values
* @return a new instance of DecodePng
* @see org.tensorflow.op.image.DecodePng
*/
public DecodePng<TUint8> decodePng(Operand<TString> contents, DecodePng.Options... options) {
return DecodePng.create(scope, contents, options);
}

/**
* Builds an {@link DecodeAndCropJpeg} operation
*
Expand Down Expand Up @@ -296,19 +308,6 @@ public CombinedNonMaxSuppression combinedNonMaxSuppression(Operand<TFloat32> box
return CombinedNonMaxSuppression.create(scope, boxes, scores, maxOutputSizePerClass, maxTotalSize, iouThreshold, scoreThreshold, options);
}

/**
* Builds an {@link EncodeJpegVariableQuality} operation
*
* @param images Images to adjust. At least 3-D.
* @param quality An int quality to encode to.
* @return a new instance of EncodeJpegVariableQuality
* @see org.tensorflow.op.image.EncodeJpegVariableQuality
*/
public EncodeJpegVariableQuality encodeJpegVariableQuality(Operand<TUInt8> images,
Operand<TInt32> quality) {
return EncodeJpegVariableQuality.create(scope, images, quality);
}

/**
* Builds an {@link CropAndResizeGradBoxes} operation
*
Expand Down Expand Up @@ -352,6 +351,19 @@ public <T extends TNumber> EncodePng encodePng(Operand<T> image, EncodePng.Optio
return EncodePng.create(scope, image, options);
}

/**
* Builds an {@link EncodeJpegVariableQuality} operation
*
* @param images Images to adjust. At least 3-D.
* @param quality An int quality to encode to.
* @return a new instance of EncodeJpegVariableQuality
* @see org.tensorflow.op.image.EncodeJpegVariableQuality
*/
public EncodeJpegVariableQuality encodeJpegVariableQuality(Operand<TUint8> images,
Operand<TInt32> quality) {
return EncodeJpegVariableQuality.create(scope, images, quality);
}

/**
* Builds an {@link ScaleAndTranslate} operation
*
Expand Down Expand Up @@ -383,18 +395,6 @@ public <T extends TNumber> DrawBoundingBoxes<T> drawBoundingBoxes(Operand<T> ima
return DrawBoundingBoxes.create(scope, images, boxes, colors);
}

/**
* Builds an {@link DecodePng} operation
*
* @param contents 0-D. The PNG-encoded image.
* @param options carries optional attributes values
* @return a new instance of DecodePng
* @see org.tensorflow.op.image.DecodePng
*/
public DecodePng<TUInt8> decodePng(Operand<TString> contents, DecodePng.Options... options) {
return DecodePng.create(scope, contents, options);
}

/**
* Builds an {@link ResizeNearestNeighbor} operation
*
Expand Down Expand Up @@ -467,18 +467,6 @@ public <T extends TNumber> CropAndResizeGradImage<T> cropAndResizeGradImage(
return CropAndResizeGradImage.create(scope, grads, boxes, boxInd, imageSize, T, options);
}

/**
* Builds an {@link EncodeJpeg} operation
*
* @param image 3-D with shape `[height, width, channels]`.
* @param options carries optional attributes values
* @return a new instance of EncodeJpeg
* @see org.tensorflow.op.image.EncodeJpeg
*/
public EncodeJpeg encodeJpeg(Operand<TUInt8> image, EncodeJpeg.Options... options) {
return EncodeJpeg.create(scope, image, options);
}

/**
* Builds an {@link DecodeJpeg} operation
*
Expand All @@ -491,6 +479,18 @@ public DecodeJpeg decodeJpeg(Operand<TString> contents, DecodeJpeg.Options... op
return DecodeJpeg.create(scope, contents, options);
}

/**
* Builds an {@link EncodeJpeg} operation
*
* @param image 3-D with shape `[height, width, channels]`.
* @param options carries optional attributes values
* @return a new instance of EncodeJpeg
* @see org.tensorflow.op.image.EncodeJpeg
*/
public EncodeJpeg encodeJpeg(Operand<TUint8> image, EncodeJpeg.Options... options) {
return EncodeJpeg.create(scope, image, options);
}

/**
* Builds an {@link ExtractGlimpse} operation
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import org.tensorflow.op.Scope;
import org.tensorflow.op.annotation.Operator;
import org.tensorflow.types.TString;
import org.tensorflow.types.TUInt8;
import org.tensorflow.types.TUint8;
import org.tensorflow.types.family.TType;

/**
Expand Down Expand Up @@ -61,7 +61,7 @@
* Fingerprint(ReduceJoin(data))` in general.
*/
@Operator
public final class Fingerprint extends PrimitiveOp implements Operand<TUInt8> {
public final class Fingerprint extends PrimitiveOp implements Operand<TUint8> {

/**
* Factory method to create a class wrapping a new Fingerprint operation.
Expand All @@ -85,16 +85,16 @@ public static <T extends TType> Fingerprint create(Scope scope, Operand<T> data,
* `data`'s first dimension, and the second dimension size depends on the
* fingerprint algorithm.
*/
public Output<TUInt8> fingerprint() {
public Output<TUint8> fingerprint() {
return fingerprint;
}

@Override
public Output<TUInt8> asOutput() {
public Output<TUint8> asOutput() {
return fingerprint;
}

private Output<TUInt8> fingerprint;
private Output<TUint8> fingerprint;

private Fingerprint(Operation operation) {
super(operation);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import org.tensorflow.op.annotation.Operator;
import org.tensorflow.types.TInt32;
import org.tensorflow.types.TString;
import org.tensorflow.types.TUInt8;
import org.tensorflow.types.TUint8;

/**
* Decode and Crop a JPEG-encoded image to a uint8 tensor.
Expand Down Expand Up @@ -57,7 +57,7 @@
* decoding partial jpeg image.
*/
@Operator(group = "image")
public final class DecodeAndCropJpeg extends PrimitiveOp implements Operand<TUInt8> {
public final class DecodeAndCropJpeg extends PrimitiveOp implements Operand<TUint8> {

/**
* Optional attributes for {@link org.tensorflow.op.image.DecodeAndCropJpeg}
Expand Down Expand Up @@ -221,16 +221,16 @@ public static Options dctMethod(String dctMethod) {
/**
* 3-D with shape `[height, width, channels]`..
*/
public Output<TUInt8> image() {
public Output<TUint8> image() {
return image;
}

@Override
public Output<TUInt8> asOutput() {
public Output<TUint8> asOutput() {
return image;
}

private Output<TUInt8> image;
private Output<TUint8> image;

private DecodeAndCropJpeg(Operation operation) {
super(operation);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import org.tensorflow.op.Scope;
import org.tensorflow.op.annotation.Operator;
import org.tensorflow.types.TString;
import org.tensorflow.types.TUInt8;
import org.tensorflow.types.TUint8;

/**
* Decode the first frame of a BMP-encoded image to a uint8 tensor.
Expand All @@ -45,7 +45,7 @@
* 4: output an RGBA image.
*/
@Operator(group = "image")
public final class DecodeBmp extends PrimitiveOp implements Operand<TUInt8> {
public final class DecodeBmp extends PrimitiveOp implements Operand<TUint8> {

/**
* Optional attributes for {@link org.tensorflow.op.image.DecodeBmp}
Expand Down Expand Up @@ -98,16 +98,16 @@ public static Options channels(Long channels) {
/**
* 3-D with shape `[height, width, channels]`. RGB order
*/
public Output<TUInt8> image() {
public Output<TUint8> image() {
return image;
}

@Override
public Output<TUInt8> asOutput() {
public Output<TUint8> asOutput() {
return image;
}

private Output<TUInt8> image;
private Output<TUint8> image;

private DecodeBmp(Operation operation) {
super(operation);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import org.tensorflow.op.Scope;
import org.tensorflow.op.annotation.Operator;
import org.tensorflow.types.TString;
import org.tensorflow.types.TUInt8;
import org.tensorflow.types.TUint8;

/**
* Decode the frame(s) of a GIF-encoded image to a uint8 tensor.
Expand All @@ -40,7 +40,7 @@
* `tf.image.decode_image`.
*/
@Operator(group = "image")
public final class DecodeGif extends PrimitiveOp implements Operand<TUInt8> {
public final class DecodeGif extends PrimitiveOp implements Operand<TUint8> {

/**
* Factory method to create a class wrapping a new DecodeGif operation.
Expand All @@ -59,16 +59,16 @@ public static DecodeGif create(Scope scope, Operand<TString> contents) {
/**
* 4-D with shape `[num_frames, height, width, 3]`. RGB channel order.
*/
public Output<TUInt8> image() {
public Output<TUint8> image() {
return image;
}

@Override
public Output<TUInt8> asOutput() {
public Output<TUint8> asOutput() {
return image;
}

private Output<TUInt8> image;
private Output<TUint8> image;

private DecodeGif(Operation operation) {
super(operation);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import org.tensorflow.op.Scope;
import org.tensorflow.op.annotation.Operator;
import org.tensorflow.types.TString;
import org.tensorflow.types.TUInt8;
import org.tensorflow.types.TUint8;

/**
* Decode a JPEG-encoded image to a uint8 tensor.
Expand Down Expand Up @@ -56,7 +56,7 @@
* the same, though it is cleaner to use `tf.image.decode_image`.
*/
@Operator(group = "image")
public final class DecodeJpeg extends PrimitiveOp implements Operand<TUInt8> {
public final class DecodeJpeg extends PrimitiveOp implements Operand<TUint8> {

/**
* Optional attributes for {@link org.tensorflow.op.image.DecodeJpeg}
Expand Down Expand Up @@ -218,16 +218,16 @@ public static Options dctMethod(String dctMethod) {
/**
* 3-D with shape `[height, width, channels]`..
*/
public Output<TUInt8> image() {
public Output<TUint8> image() {
return image;
}

@Override
public Output<TUInt8> asOutput() {
public Output<TUint8> asOutput() {
return image;
}

private Output<TUInt8> image;
private Output<TUint8> image;

private DecodeJpeg(Operation operation) {
super(operation);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import org.tensorflow.op.Scope;
import org.tensorflow.op.annotation.Operator;
import org.tensorflow.types.TString;
import org.tensorflow.types.TUInt8;
import org.tensorflow.types.TUint8;
import org.tensorflow.types.family.TNumber;
import org.tensorflow.types.family.TType;

Expand Down Expand Up @@ -113,8 +113,8 @@ public static <T extends TNumber> DecodePng<T> create(Scope scope, Operand<TStri
* @param options carries optional attributes values
* @return a new instance of DecodePng
*/
public static DecodePng<TUInt8> create(Scope scope, Operand<TString> contents, Options... options) {
return create(scope, contents, TUInt8.DTYPE, options);
public static DecodePng<TUint8> create(Scope scope, Operand<TString> contents, Options... options) {
return create(scope, contents, TUint8.DTYPE, options);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import org.tensorflow.op.Scope;
import org.tensorflow.op.annotation.Operator;
import org.tensorflow.types.TString;
import org.tensorflow.types.TUInt8;
import org.tensorflow.types.TUint8;

/**
* JPEG-encode an image.
Expand Down Expand Up @@ -159,7 +159,7 @@ private Options() {
* @param options carries optional attributes values
* @return a new instance of EncodeJpeg
*/
public static EncodeJpeg create(Scope scope, Operand<TUInt8> image, Options... options) {
public static EncodeJpeg create(Scope scope, Operand<TUint8> image, Options... options) {
OperationBuilder opBuilder = scope.env().opBuilder("EncodeJpeg", scope.makeOpName("EncodeJpeg"));
opBuilder.addInput(image.asOutput());
opBuilder = scope.applyControlDependencies(opBuilder);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import org.tensorflow.op.annotation.Operator;
import org.tensorflow.types.TInt32;
import org.tensorflow.types.TString;
import org.tensorflow.types.TUInt8;
import org.tensorflow.types.TUint8;

/**
* JPEG encode input image with provided compression quality.
Expand All @@ -46,7 +46,7 @@ public final class EncodeJpegVariableQuality extends PrimitiveOp implements Oper
* @param quality An int quality to encode to.
* @return a new instance of EncodeJpegVariableQuality
*/
public static EncodeJpegVariableQuality create(Scope scope, Operand<TUInt8> images, Operand<TInt32> quality) {
public static EncodeJpegVariableQuality create(Scope scope, Operand<TUint8> images, Operand<TInt32> quality) {
OperationBuilder opBuilder = scope.env().opBuilder("EncodeJpegVariableQuality", scope.makeOpName("EncodeJpegVariableQuality"));
opBuilder.addInput(images.asOutput());
opBuilder.addInput(quality.asOutput());
Expand Down
Loading