Fixes multiple typos in the calculator's internal files.
PiperOrigin-RevId: 580907788
This commit is contained in:
parent
7c5c216652
commit
a9a169372a
|
@ -80,7 +80,7 @@ message SpectrogramCalculatorOptions {
|
||||||
// If use_local_timestamp is true, the output packet's timestamp is based on
|
// If use_local_timestamp is true, the output packet's timestamp is based on
|
||||||
// the last sample of the packet and it's inferred from the latest input
|
// the last sample of the packet and it's inferred from the latest input
|
||||||
// packet's timestamp. If false, the output packet's timestamp is based on
|
// packet's timestamp. If false, the output packet's timestamp is based on
|
||||||
// the cumulative timestamping, which is inferred from the intial input
|
// the cumulative timestamping, which is inferred from the initial input
|
||||||
// timestamp and the cumulative number of samples.
|
// timestamp and the cumulative number of samples.
|
||||||
optional bool use_local_timestamp = 8 [default = false];
|
optional bool use_local_timestamp = 8 [default = false];
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,7 +66,7 @@ message TimeSeriesFramerCalculatorOptions {
|
||||||
// If use_local_timestamp is true, the output packet's timestamp is based on
|
// If use_local_timestamp is true, the output packet's timestamp is based on
|
||||||
// the last sample of the packet and it's inferred from the latest input
|
// the last sample of the packet and it's inferred from the latest input
|
||||||
// packet's timestamp. If false, the output packet's timestamp is based on
|
// packet's timestamp. If false, the output packet's timestamp is based on
|
||||||
// the cumulative timestamping, which is inferred from the intial input
|
// the cumulative timestamping, which is inferred from the initial input
|
||||||
// timestamp and the cumulative number of samples.
|
// timestamp and the cumulative number of samples.
|
||||||
optional bool use_local_timestamp = 6 [default = false];
|
optional bool use_local_timestamp = 6 [default = false];
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,7 +71,7 @@ TEST_F(PacketSequencerCalculatorTest, IsRegistered) {
|
||||||
CalculatorBaseRegistry::IsRegistered("PacketSequencerCalculator"));
|
CalculatorBaseRegistry::IsRegistered("PacketSequencerCalculator"));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Shows how control packets recieve timestamps before and after frame packets
|
// Shows how control packets receive timestamps before and after frame packets
|
||||||
// have arrived.
|
// have arrived.
|
||||||
TEST_F(PacketSequencerCalculatorTest, ChannelEarly) {
|
TEST_F(PacketSequencerCalculatorTest, ChannelEarly) {
|
||||||
CalculatorGraphConfig::Node node_config = BuildNodeConfig();
|
CalculatorGraphConfig::Node node_config = BuildNodeConfig();
|
||||||
|
|
|
@ -174,7 +174,7 @@ TEST(ValueOrDefaultCalculatorTest, DefaultAndValues) {
|
||||||
ElementsAre(kDefaultValue, 1, 2, kDefaultValue, 3, kDefaultValue));
|
ElementsAre(kDefaultValue, 1, 2, kDefaultValue, 3, kDefaultValue));
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(ValueOrDefaultCalculatorTest, TimestampsMissmatch) {
|
TEST(ValueOrDefaultCalculatorTest, TimestampsMismatch) {
|
||||||
// Check that when we provide the inputs not on time - we don't get them.
|
// Check that when we provide the inputs not on time - we don't get them.
|
||||||
ValueOrDefaultRunner runner;
|
ValueOrDefaultRunner runner;
|
||||||
const std::vector<int64_t> ticks = {1, 2, 5, 8, 12, 33, 231};
|
const std::vector<int64_t> ticks = {1, 2, 5, 8, 12, 33, 231};
|
||||||
|
|
|
@ -59,7 +59,7 @@ class OpenCvRunner
|
||||||
const ImageFrame& input, const std::array<float, 16>& matrix,
|
const ImageFrame& input, const std::array<float, 16>& matrix,
|
||||||
const AffineTransformation::Size& size,
|
const AffineTransformation::Size& size,
|
||||||
AffineTransformation::BorderMode border_mode) override {
|
AffineTransformation::BorderMode border_mode) override {
|
||||||
// OpenCV warpAffine works in absolute coordinates, so the transfom (which
|
// OpenCV warpAffine works in absolute coordinates, so the transform (which
|
||||||
// accepts and produces relative coordinates) should be adjusted to first
|
// accepts and produces relative coordinates) should be adjusted to first
|
||||||
// normalize coordinates and then scale them.
|
// normalize coordinates and then scale them.
|
||||||
// clang-format off
|
// clang-format off
|
||||||
|
|
|
@ -24,7 +24,7 @@ message ImageCroppingCalculatorOptions {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Output texture buffer dimensions. The values defined in the options will be
|
// Output texture buffer dimensions. The values defined in the options will be
|
||||||
// overriden by the WIDTH and HEIGHT input streams if they exist.
|
// overridden by the WIDTH and HEIGHT input streams if they exist.
|
||||||
optional int32 width = 1;
|
optional int32 width = 1;
|
||||||
optional int32 height = 2;
|
optional int32 height = 2;
|
||||||
|
|
||||||
|
|
|
@ -77,7 +77,7 @@ absl::StatusOr<double> ComputeFocalLengthInPixels(int image_width,
|
||||||
return focal_length_pixels;
|
return focal_length_pixels;
|
||||||
}
|
}
|
||||||
|
|
||||||
absl::StatusOr<ImageFileProperties> GetImageFileProperites(
|
absl::StatusOr<ImageFileProperties> GetImageFileProperties(
|
||||||
const std::string& image_bytes) {
|
const std::string& image_bytes) {
|
||||||
easyexif::EXIFInfo result;
|
easyexif::EXIFInfo result;
|
||||||
int code = result.parseFrom(image_bytes);
|
int code = result.parseFrom(image_bytes);
|
||||||
|
@ -151,7 +151,7 @@ class ImageFilePropertiesCalculator : public CalculatorBase {
|
||||||
if (cc->InputSidePackets().NumEntries() == 1) {
|
if (cc->InputSidePackets().NumEntries() == 1) {
|
||||||
const std::string& image_bytes =
|
const std::string& image_bytes =
|
||||||
cc->InputSidePackets().Index(0).Get<std::string>();
|
cc->InputSidePackets().Index(0).Get<std::string>();
|
||||||
MP_ASSIGN_OR_RETURN(properties_, GetImageFileProperites(image_bytes));
|
MP_ASSIGN_OR_RETURN(properties_, GetImageFileProperties(image_bytes));
|
||||||
read_properties_ = true;
|
read_properties_ = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -169,7 +169,7 @@ class ImageFilePropertiesCalculator : public CalculatorBase {
|
||||||
return absl::OkStatus();
|
return absl::OkStatus();
|
||||||
}
|
}
|
||||||
const std::string& image_bytes = cc->Inputs().Index(0).Get<std::string>();
|
const std::string& image_bytes = cc->Inputs().Index(0).Get<std::string>();
|
||||||
MP_ASSIGN_OR_RETURN(properties_, GetImageFileProperites(image_bytes));
|
MP_ASSIGN_OR_RETURN(properties_, GetImageFileProperties(image_bytes));
|
||||||
read_properties_ = true;
|
read_properties_ = true;
|
||||||
}
|
}
|
||||||
if (read_properties_) {
|
if (read_properties_) {
|
||||||
|
|
|
@ -284,7 +284,7 @@ std::array<float, 16> GetMatrix(cv::Mat input, mediapipe::NormalizedRect roi,
|
||||||
.IgnoreError();
|
.IgnoreError();
|
||||||
mediapipe::GetRotatedSubRectToRectTransformMatrix(
|
mediapipe::GetRotatedSubRectToRectTransformMatrix(
|
||||||
roi_absolute, input.cols, input.rows,
|
roi_absolute, input.cols, input.rows,
|
||||||
/*flip_horizontaly=*/false, &transform_mat);
|
/*flip_horizontally=*/false, &transform_mat);
|
||||||
return transform_mat;
|
return transform_mat;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,7 @@ std::string FourCCToString(libyuv::FourCC fourcc) {
|
||||||
// The input `YUVImage` is expected to be in the NV12, NV21, YV12 or I420 (aka
|
// The input `YUVImage` is expected to be in the NV12, NV21, YV12 or I420 (aka
|
||||||
// YV21) format (as per the `fourcc()` property). This covers the most commonly
|
// YV21) format (as per the `fourcc()` property). This covers the most commonly
|
||||||
// used YUV image formats used on mobile devices. Other formats are not
|
// used YUV image formats used on mobile devices. Other formats are not
|
||||||
// supported and wil result in an `InvalidArgumentError`.
|
// supported and will result in an `InvalidArgumentError`.
|
||||||
class YUVToImageCalculator : public Node {
|
class YUVToImageCalculator : public Node {
|
||||||
public:
|
public:
|
||||||
static constexpr Input<YUVImage> kInput{"YUV_IMAGE"};
|
static constexpr Input<YUVImage> kInput{"YUV_IMAGE"};
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
The model files add.bin, add_quantized.bin
|
The model files add.bin, add_quantized.bin
|
||||||
(and corresponding metatada json files) come from tensorflow/lite/testdata/
|
(and corresponding metadata json files) come from tensorflow/lite/testdata/
|
||||||
|
|
|
@ -95,7 +95,7 @@ struct GPUData {
|
||||||
// into a TfLiteTensor (float 32) or a GpuBuffer to a tflite::gpu::GlBuffer
|
// into a TfLiteTensor (float 32) or a GpuBuffer to a tflite::gpu::GlBuffer
|
||||||
// or MTLBuffer.
|
// or MTLBuffer.
|
||||||
//
|
//
|
||||||
// This calculator is designed to be used with the TfLiteInferenceCalcualtor,
|
// This calculator is designed to be used with the TfLiteInferenceCalculator,
|
||||||
// as a pre-processing step for calculator inputs.
|
// as a pre-processing step for calculator inputs.
|
||||||
//
|
//
|
||||||
// IMAGE and IMAGE_GPU inputs are normalized to [-1,1] (default) or [0,1],
|
// IMAGE and IMAGE_GPU inputs are normalized to [-1,1] (default) or [0,1],
|
||||||
|
|
|
@ -31,7 +31,7 @@ message TfLiteConverterCalculatorOptions {
|
||||||
// Custom settings to override the internal scaling factors `div` and `sub`.
|
// Custom settings to override the internal scaling factors `div` and `sub`.
|
||||||
// Both values must be set to non-negative values. Will only take effect on
|
// Both values must be set to non-negative values. Will only take effect on
|
||||||
// CPU AND when |use_custom_normalization| is set to true. When these custom
|
// CPU AND when |use_custom_normalization| is set to true. When these custom
|
||||||
// values take effect, the |zero_center| setting above will be overriden, and
|
// values take effect, the |zero_center| setting above will be overridden, and
|
||||||
// the normalized_value will be calculated as:
|
// the normalized_value will be calculated as:
|
||||||
// normalized_value = input / custom_div - custom_sub.
|
// normalized_value = input / custom_div - custom_sub.
|
||||||
optional bool use_custom_normalization = 6 [default = false];
|
optional bool use_custom_normalization = 6 [default = false];
|
||||||
|
|
|
@ -25,7 +25,7 @@ message TfLiteTensorsToClassificationCalculatorOptions {
|
||||||
optional TfLiteTensorsToClassificationCalculatorOptions ext = 266399463;
|
optional TfLiteTensorsToClassificationCalculatorOptions ext = 266399463;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Score threshold for perserving the class.
|
// Score threshold for preserving the class.
|
||||||
optional float min_score_threshold = 1;
|
optional float min_score_threshold = 1;
|
||||||
// Number of highest scoring labels to output. If top_k is not positive then
|
// Number of highest scoring labels to output. If top_k is not positive then
|
||||||
// all labels are used.
|
// all labels are used.
|
||||||
|
|
|
@ -116,7 +116,7 @@ void ConvertAnchorsToRawValues(const std::vector<Anchor>& anchors,
|
||||||
// tensors can have 2 or 3 tensors. First tensor is the predicted
|
// tensors can have 2 or 3 tensors. First tensor is the predicted
|
||||||
// raw boxes/keypoints. The size of the values must be (num_boxes
|
// raw boxes/keypoints. The size of the values must be (num_boxes
|
||||||
// * num_predicted_values). Second tensor is the score tensor. The
|
// * num_predicted_values). Second tensor is the score tensor. The
|
||||||
// size of the valuse must be (num_boxes * num_classes). It's
|
// size of the values must be (num_boxes * num_classes). It's
|
||||||
// optional to pass in a third tensor for anchors (e.g. for SSD
|
// optional to pass in a third tensor for anchors (e.g. for SSD
|
||||||
// models) depend on the outputs of the detection model. The size
|
// models) depend on the outputs of the detection model. The size
|
||||||
// of anchor tensor must be (num_boxes * 4).
|
// of anchor tensor must be (num_boxes * 4).
|
||||||
|
|
|
@ -69,6 +69,6 @@ message TfLiteTensorsToDetectionsCalculatorOptions {
|
||||||
// representation has a bottom-left origin (e.g., in OpenGL).
|
// representation has a bottom-left origin (e.g., in OpenGL).
|
||||||
optional bool flip_vertically = 18 [default = false];
|
optional bool flip_vertically = 18 [default = false];
|
||||||
|
|
||||||
// Score threshold for perserving decoded detections.
|
// Score threshold for preserving decoded detections.
|
||||||
optional float min_score_thresh = 19;
|
optional float min_score_thresh = 19;
|
||||||
}
|
}
|
||||||
|
|
|
@ -158,7 +158,7 @@ absl::Status TfLiteTensorsToLandmarksCalculator::Open(CalculatorContext* cc) {
|
||||||
RET_CHECK(options_.has_input_image_height() &&
|
RET_CHECK(options_.has_input_image_height() &&
|
||||||
options_.has_input_image_width())
|
options_.has_input_image_width())
|
||||||
<< "Must provide input width/height for using flip_vertically option "
|
<< "Must provide input width/height for using flip_vertically option "
|
||||||
"when outputing landmarks in absolute coordinates.";
|
"when outputting landmarks in absolute coordinates.";
|
||||||
}
|
}
|
||||||
|
|
||||||
flip_horizontally_ =
|
flip_horizontally_ =
|
||||||
|
|
Loading…
Reference in New Issue
Block a user