Internal change
PiperOrigin-RevId: 494914168
This commit is contained in:
parent
3f66dde8fd
commit
fb21797611
|
@ -37,7 +37,8 @@ enum { ATTRIB_VERTEX, ATTRIB_TEXTURE_POSITION, NUM_ATTRIBUTES };
|
||||||
namespace mediapipe {
|
namespace mediapipe {
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
using ::mediapipe::NormalizedRect;
|
||||||
|
using ::mediapipe::Rect;
|
||||||
#if !MEDIAPIPE_DISABLE_GPU
|
#if !MEDIAPIPE_DISABLE_GPU
|
||||||
|
|
||||||
#endif // !MEDIAPIPE_DISABLE_GPU
|
#endif // !MEDIAPIPE_DISABLE_GPU
|
||||||
|
|
|
@ -195,11 +195,11 @@ TEST(ImageCroppingCalculatorTest, RedundantSpecWithInputStream) {
|
||||||
auto cc = absl::make_unique<CalculatorContext>(
|
auto cc = absl::make_unique<CalculatorContext>(
|
||||||
calculator_state.get(), inputTags, tool::CreateTagMap({}).value());
|
calculator_state.get(), inputTags, tool::CreateTagMap({}).value());
|
||||||
auto& inputs = cc->Inputs();
|
auto& inputs = cc->Inputs();
|
||||||
mediapipe::Rect rect = ParseTextProtoOrDie<mediapipe::Rect>(
|
Rect rect = ParseTextProtoOrDie<Rect>(
|
||||||
R"pb(
|
R"pb(
|
||||||
width: 1 height: 1 x_center: 40 y_center: 40 rotation: 0.5
|
width: 1 height: 1 x_center: 40 y_center: 40 rotation: 0.5
|
||||||
)pb");
|
)pb");
|
||||||
inputs.Tag(kRectTag).Value() = MakePacket<mediapipe::Rect>(rect);
|
inputs.Tag(kRectTag).Value() = MakePacket<Rect>(rect);
|
||||||
RectSpec expectRect = {
|
RectSpec expectRect = {
|
||||||
.width = 1,
|
.width = 1,
|
||||||
.height = 1,
|
.height = 1,
|
||||||
|
|
|
@ -37,6 +37,9 @@ constexpr char kNormRectTag[] = "NORM_RECT";
|
||||||
constexpr char kRectsTag[] = "RECTS";
|
constexpr char kRectsTag[] = "RECTS";
|
||||||
constexpr char kNormRectsTag[] = "NORM_RECTS";
|
constexpr char kNormRectsTag[] = "NORM_RECTS";
|
||||||
|
|
||||||
|
using ::mediapipe::NormalizedRect;
|
||||||
|
using ::mediapipe::Rect;
|
||||||
|
|
||||||
constexpr float kMinFloat = std::numeric_limits<float>::lowest();
|
constexpr float kMinFloat = std::numeric_limits<float>::lowest();
|
||||||
constexpr float kMaxFloat = std::numeric_limits<float>::max();
|
constexpr float kMaxFloat = std::numeric_limits<float>::max();
|
||||||
|
|
||||||
|
|
|
@ -39,6 +39,9 @@ constexpr char kImageSizeTag[] = "IMAGE_SIZE";
|
||||||
constexpr char kRectTag[] = "RECT";
|
constexpr char kRectTag[] = "RECT";
|
||||||
constexpr char kDetectionTag[] = "DETECTION";
|
constexpr char kDetectionTag[] = "DETECTION";
|
||||||
|
|
||||||
|
using ::mediapipe::NormalizedRect;
|
||||||
|
using ::mediapipe::Rect;
|
||||||
|
|
||||||
MATCHER_P4(RectEq, x_center, y_center, width, height, "") {
|
MATCHER_P4(RectEq, x_center, y_center, width, height, "") {
|
||||||
return testing::Value(arg.x_center(), testing::Eq(x_center)) &&
|
return testing::Value(arg.x_center(), testing::Eq(x_center)) &&
|
||||||
testing::Value(arg.y_center(), testing::Eq(y_center)) &&
|
testing::Value(arg.y_center(), testing::Eq(y_center)) &&
|
||||||
|
|
|
@ -24,6 +24,8 @@
|
||||||
|
|
||||||
namespace mediapipe {
|
namespace mediapipe {
|
||||||
|
|
||||||
|
using ::mediapipe::NormalizedRect;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
constexpr char kLandmarksTag[] = "NORM_LANDMARKS";
|
constexpr char kLandmarksTag[] = "NORM_LANDMARKS";
|
||||||
|
|
|
@ -35,7 +35,9 @@ constexpr char kObjectScaleRoiTag[] = "OBJECT_SCALE_ROI";
|
||||||
constexpr char kNormalizedFilteredLandmarksTag[] = "NORM_FILTERED_LANDMARKS";
|
constexpr char kNormalizedFilteredLandmarksTag[] = "NORM_FILTERED_LANDMARKS";
|
||||||
constexpr char kFilteredLandmarksTag[] = "FILTERED_LANDMARKS";
|
constexpr char kFilteredLandmarksTag[] = "FILTERED_LANDMARKS";
|
||||||
|
|
||||||
|
using ::mediapipe::NormalizedRect;
|
||||||
using mediapipe::OneEuroFilter;
|
using mediapipe::OneEuroFilter;
|
||||||
|
using ::mediapipe::Rect;
|
||||||
using mediapipe::RelativeVelocityFilter;
|
using mediapipe::RelativeVelocityFilter;
|
||||||
|
|
||||||
void NormalizedLandmarksToLandmarks(
|
void NormalizedLandmarksToLandmarks(
|
||||||
|
|
|
@ -23,6 +23,8 @@ namespace {
|
||||||
constexpr char kNormRectTag[] = "NORM_RECT";
|
constexpr char kNormRectTag[] = "NORM_RECT";
|
||||||
constexpr char kNormReferenceRectTag[] = "NORM_REFERENCE_RECT";
|
constexpr char kNormReferenceRectTag[] = "NORM_REFERENCE_RECT";
|
||||||
|
|
||||||
|
using ::mediapipe::NormalizedRect;
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
// Projects rectangle from reference coordinate system (defined by reference
|
// Projects rectangle from reference coordinate system (defined by reference
|
||||||
|
|
|
@ -29,6 +29,9 @@ constexpr char kNormRectsTag[] = "NORM_RECTS";
|
||||||
constexpr char kRectsTag[] = "RECTS";
|
constexpr char kRectsTag[] = "RECTS";
|
||||||
constexpr char kRenderDataTag[] = "RENDER_DATA";
|
constexpr char kRenderDataTag[] = "RENDER_DATA";
|
||||||
|
|
||||||
|
using ::mediapipe::NormalizedRect;
|
||||||
|
using ::mediapipe::Rect;
|
||||||
|
|
||||||
RenderAnnotation::Rectangle* NewRect(
|
RenderAnnotation::Rectangle* NewRect(
|
||||||
const RectToRenderDataCalculatorOptions& options, RenderData* render_data) {
|
const RectToRenderDataCalculatorOptions& options, RenderData* render_data) {
|
||||||
auto* annotation = render_data->add_render_annotations();
|
auto* annotation = render_data->add_render_annotations();
|
||||||
|
|
|
@ -24,6 +24,8 @@ constexpr char kNormRectTag[] = "NORM_RECT";
|
||||||
constexpr char kImageSizeTag[] = "IMAGE_SIZE";
|
constexpr char kImageSizeTag[] = "IMAGE_SIZE";
|
||||||
constexpr char kRenderScaleTag[] = "RENDER_SCALE";
|
constexpr char kRenderScaleTag[] = "RENDER_SCALE";
|
||||||
|
|
||||||
|
using ::mediapipe::NormalizedRect;
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
// A calculator to get scale for RenderData primitives.
|
// A calculator to get scale for RenderData primitives.
|
||||||
|
|
|
@ -28,6 +28,9 @@ constexpr char kRectTag[] = "RECT";
|
||||||
constexpr char kRectsTag[] = "RECTS";
|
constexpr char kRectsTag[] = "RECTS";
|
||||||
constexpr char kImageSizeTag[] = "IMAGE_SIZE";
|
constexpr char kImageSizeTag[] = "IMAGE_SIZE";
|
||||||
|
|
||||||
|
using ::mediapipe::NormalizedRect;
|
||||||
|
using ::mediapipe::Rect;
|
||||||
|
|
||||||
// Wraps around an angle in radians to within -M_PI and M_PI.
|
// Wraps around an angle in radians to within -M_PI and M_PI.
|
||||||
inline float NormalizeRadians(float angle) {
|
inline float NormalizeRadians(float angle) {
|
||||||
return angle - 2 * M_PI * std::floor((angle - (-M_PI)) / (2 * M_PI));
|
return angle - 2 * M_PI * std::floor((angle - (-M_PI)) / (2 * M_PI));
|
||||||
|
|
|
@ -22,6 +22,8 @@
|
||||||
|
|
||||||
namespace mediapipe {
|
namespace mediapipe {
|
||||||
|
|
||||||
|
using ::mediapipe::NormalizedRect;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
constexpr char kLandmarksTag[] = "LANDMARKS";
|
constexpr char kLandmarksTag[] = "LANDMARKS";
|
||||||
|
|
|
@ -32,6 +32,8 @@
|
||||||
namespace mediapipe {
|
namespace mediapipe {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
using ::mediapipe::NormalizedRect;
|
||||||
|
|
||||||
constexpr int kDetectionUpdateTimeOutMS = 5000;
|
constexpr int kDetectionUpdateTimeOutMS = 5000;
|
||||||
constexpr char kDetectionsTag[] = "DETECTIONS";
|
constexpr char kDetectionsTag[] = "DETECTIONS";
|
||||||
constexpr char kDetectionBoxesTag[] = "DETECTION_BOXES";
|
constexpr char kDetectionBoxesTag[] = "DETECTION_BOXES";
|
||||||
|
|
|
@ -22,6 +22,8 @@
|
||||||
|
|
||||||
namespace mediapipe {
|
namespace mediapipe {
|
||||||
|
|
||||||
|
using ::mediapipe::NormalizedRect;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
// NORM_LANDMARKS is either the full set of landmarks for the hand, or
|
// NORM_LANDMARKS is either the full set of landmarks for the hand, or
|
||||||
|
|
|
@ -34,6 +34,8 @@ constexpr char kRecropRectTag[] = "RECROP_RECT";
|
||||||
constexpr char kImageSizeTag[] = "IMAGE_SIZE";
|
constexpr char kImageSizeTag[] = "IMAGE_SIZE";
|
||||||
constexpr char kTrackingRectTag[] = "TRACKING_RECT";
|
constexpr char kTrackingRectTag[] = "TRACKING_RECT";
|
||||||
|
|
||||||
|
using ::mediapipe::NormalizedRect;
|
||||||
|
|
||||||
// TODO: Use rect rotation.
|
// TODO: Use rect rotation.
|
||||||
// Verifies that Intersection over Union of previous frame rect and current
|
// Verifies that Intersection over Union of previous frame rect and current
|
||||||
// frame re-crop rect is less than threshold.
|
// frame re-crop rect is less than threshold.
|
||||||
|
|
|
@ -34,6 +34,8 @@ namespace {
|
||||||
constexpr char kInputFrameAnnotationTag[] = "FRAME_ANNOTATION";
|
constexpr char kInputFrameAnnotationTag[] = "FRAME_ANNOTATION";
|
||||||
constexpr char kOutputNormRectsTag[] = "NORM_RECTS";
|
constexpr char kOutputNormRectsTag[] = "NORM_RECTS";
|
||||||
|
|
||||||
|
using ::mediapipe::NormalizedRect;
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
// A calculator that converts FrameAnnotation proto to NormalizedRect.
|
// A calculator that converts FrameAnnotation proto to NormalizedRect.
|
||||||
|
|
|
@ -45,6 +45,7 @@ namespace components {
|
||||||
namespace processors {
|
namespace processors {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
using ::mediapipe::NormalizedRect;
|
||||||
using ::mediapipe::Tensor;
|
using ::mediapipe::Tensor;
|
||||||
using ::mediapipe::api2::Input;
|
using ::mediapipe::api2::Input;
|
||||||
using ::mediapipe::api2::Output;
|
using ::mediapipe::api2::Output;
|
||||||
|
|
|
@ -35,6 +35,8 @@ limitations under the License.
|
||||||
namespace mediapipe {
|
namespace mediapipe {
|
||||||
namespace api2 {
|
namespace api2 {
|
||||||
|
|
||||||
|
using ::mediapipe::NormalizedRect;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
constexpr char kLandmarksTag[] = "LANDMARKS";
|
constexpr char kLandmarksTag[] = "LANDMARKS";
|
||||||
|
|
|
@ -33,6 +33,8 @@ namespace mediapipe {
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
using ::mediapipe::NormalizedRect;
|
||||||
|
|
||||||
constexpr char kLandmarksTag[] = "LANDMARKS";
|
constexpr char kLandmarksTag[] = "LANDMARKS";
|
||||||
constexpr char kWorldLandmarksTag[] = "WORLD_LANDMARKS";
|
constexpr char kWorldLandmarksTag[] = "WORLD_LANDMARKS";
|
||||||
constexpr char kImageSizeTag[] = "IMAGE_SIZE";
|
constexpr char kImageSizeTag[] = "IMAGE_SIZE";
|
||||||
|
|
|
@ -57,6 +57,8 @@ namespace {
|
||||||
using GestureRecognizerGraphOptionsProto = ::mediapipe::tasks::vision::
|
using GestureRecognizerGraphOptionsProto = ::mediapipe::tasks::vision::
|
||||||
gesture_recognizer::proto::GestureRecognizerGraphOptions;
|
gesture_recognizer::proto::GestureRecognizerGraphOptions;
|
||||||
|
|
||||||
|
using ::mediapipe::NormalizedRect;
|
||||||
|
|
||||||
constexpr char kHandGestureSubgraphTypeName[] =
|
constexpr char kHandGestureSubgraphTypeName[] =
|
||||||
"mediapipe.tasks.vision.gesture_recognizer.GestureRecognizerGraph";
|
"mediapipe.tasks.vision.gesture_recognizer.GestureRecognizerGraph";
|
||||||
|
|
||||||
|
|
|
@ -46,6 +46,7 @@ namespace gesture_recognizer {
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
using ::mediapipe::NormalizedRect;
|
||||||
using ::mediapipe::api2::Input;
|
using ::mediapipe::api2::Input;
|
||||||
using ::mediapipe::api2::Output;
|
using ::mediapipe::api2::Output;
|
||||||
using ::mediapipe::api2::builder::Graph;
|
using ::mediapipe::api2::builder::Graph;
|
||||||
|
|
|
@ -52,6 +52,7 @@ namespace gesture_recognizer {
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
using ::mediapipe::NormalizedRect;
|
||||||
using ::mediapipe::api2::Input;
|
using ::mediapipe::api2::Input;
|
||||||
using ::mediapipe::api2::Output;
|
using ::mediapipe::api2::Output;
|
||||||
using ::mediapipe::api2::builder::Graph;
|
using ::mediapipe::api2::builder::Graph;
|
||||||
|
|
|
@ -50,6 +50,7 @@ namespace hand_detector {
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
using ::mediapipe::NormalizedRect;
|
||||||
using ::mediapipe::api2::Input;
|
using ::mediapipe::api2::Input;
|
||||||
using ::mediapipe::api2::Output;
|
using ::mediapipe::api2::Output;
|
||||||
using ::mediapipe::api2::builder::Graph;
|
using ::mediapipe::api2::builder::Graph;
|
||||||
|
|
|
@ -53,6 +53,7 @@ namespace {
|
||||||
|
|
||||||
using ::file::Defaults;
|
using ::file::Defaults;
|
||||||
using ::file::GetTextProto;
|
using ::file::GetTextProto;
|
||||||
|
using ::mediapipe::NormalizedRect;
|
||||||
using ::mediapipe::api2::Input;
|
using ::mediapipe::api2::Input;
|
||||||
using ::mediapipe::api2::Output;
|
using ::mediapipe::api2::Output;
|
||||||
using ::mediapipe::api2::builder::Graph;
|
using ::mediapipe::api2::builder::Graph;
|
||||||
|
|
|
@ -27,6 +27,8 @@ limitations under the License.
|
||||||
|
|
||||||
namespace mediapipe::api2 {
|
namespace mediapipe::api2 {
|
||||||
|
|
||||||
|
using ::mediapipe::NormalizedRect;
|
||||||
|
|
||||||
// HandAssociationCalculator accepts multiple inputs of vectors of
|
// HandAssociationCalculator accepts multiple inputs of vectors of
|
||||||
// NormalizedRect. The output is a vector of NormalizedRect that contains
|
// NormalizedRect. The output is a vector of NormalizedRect that contains
|
||||||
// rects from the input vectors that don't overlap with each other. When two
|
// rects from the input vectors that don't overlap with each other. When two
|
||||||
|
|
|
@ -26,6 +26,8 @@ limitations under the License.
|
||||||
namespace mediapipe {
|
namespace mediapipe {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
using ::mediapipe::NormalizedRect;
|
||||||
|
|
||||||
class HandAssociationCalculatorTest : public testing::Test {
|
class HandAssociationCalculatorTest : public testing::Test {
|
||||||
protected:
|
protected:
|
||||||
HandAssociationCalculatorTest() {
|
HandAssociationCalculatorTest() {
|
||||||
|
|
|
@ -41,6 +41,7 @@ limitations under the License.
|
||||||
namespace mediapipe::api2 {
|
namespace mediapipe::api2 {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
using ::mediapipe::NormalizedRect;
|
||||||
using ::mediapipe::api2::Input;
|
using ::mediapipe::api2::Input;
|
||||||
using ::mediapipe::api2::Output;
|
using ::mediapipe::api2::Output;
|
||||||
using ::mediapipe::api2::builder::Source;
|
using ::mediapipe::api2::builder::Source;
|
||||||
|
|
|
@ -46,6 +46,8 @@ namespace {
|
||||||
using HandLandmarkerGraphOptionsProto = ::mediapipe::tasks::vision::
|
using HandLandmarkerGraphOptionsProto = ::mediapipe::tasks::vision::
|
||||||
hand_landmarker::proto::HandLandmarkerGraphOptions;
|
hand_landmarker::proto::HandLandmarkerGraphOptions;
|
||||||
|
|
||||||
|
using ::mediapipe::NormalizedRect;
|
||||||
|
|
||||||
constexpr char kHandLandmarkerGraphTypeName[] =
|
constexpr char kHandLandmarkerGraphTypeName[] =
|
||||||
"mediapipe.tasks.vision.hand_landmarker.HandLandmarkerGraph";
|
"mediapipe.tasks.vision.hand_landmarker.HandLandmarkerGraph";
|
||||||
|
|
||||||
|
|
|
@ -49,6 +49,7 @@ namespace hand_landmarker {
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
using ::mediapipe::NormalizedRect;
|
||||||
using ::mediapipe::api2::Input;
|
using ::mediapipe::api2::Input;
|
||||||
using ::mediapipe::api2::Output;
|
using ::mediapipe::api2::Output;
|
||||||
using ::mediapipe::api2::builder::Graph;
|
using ::mediapipe::api2::builder::Graph;
|
||||||
|
|
|
@ -54,6 +54,7 @@ namespace {
|
||||||
|
|
||||||
using ::file::Defaults;
|
using ::file::Defaults;
|
||||||
using ::file::GetTextProto;
|
using ::file::GetTextProto;
|
||||||
|
using ::mediapipe::NormalizedRect;
|
||||||
using ::mediapipe::api2::Input;
|
using ::mediapipe::api2::Input;
|
||||||
using ::mediapipe::api2::Output;
|
using ::mediapipe::api2::Output;
|
||||||
using ::mediapipe::api2::builder::Graph;
|
using ::mediapipe::api2::builder::Graph;
|
||||||
|
|
|
@ -53,6 +53,7 @@ namespace hand_landmarker {
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
using ::mediapipe::NormalizedRect;
|
||||||
using ::mediapipe::api2::Input;
|
using ::mediapipe::api2::Input;
|
||||||
using ::mediapipe::api2::Output;
|
using ::mediapipe::api2::Output;
|
||||||
using ::mediapipe::api2::builder::Graph;
|
using ::mediapipe::api2::builder::Graph;
|
||||||
|
|
|
@ -50,6 +50,7 @@ namespace {
|
||||||
|
|
||||||
using ::file::Defaults;
|
using ::file::Defaults;
|
||||||
using ::file::GetTextProto;
|
using ::file::GetTextProto;
|
||||||
|
using ::mediapipe::NormalizedRect;
|
||||||
using ::mediapipe::api2::Input;
|
using ::mediapipe::api2::Input;
|
||||||
using ::mediapipe::api2::Output;
|
using ::mediapipe::api2::Output;
|
||||||
using ::mediapipe::api2::builder::Graph;
|
using ::mediapipe::api2::builder::Graph;
|
||||||
|
|
|
@ -58,6 +58,7 @@ constexpr char kSubgraphTypeName[] =
|
||||||
"mediapipe.tasks.vision.image_classifier.ImageClassifierGraph";
|
"mediapipe.tasks.vision.image_classifier.ImageClassifierGraph";
|
||||||
constexpr int kMicroSecondsPerMilliSecond = 1000;
|
constexpr int kMicroSecondsPerMilliSecond = 1000;
|
||||||
|
|
||||||
|
using ::mediapipe::NormalizedRect;
|
||||||
using ::mediapipe::tasks::components::containers::ConvertToClassificationResult;
|
using ::mediapipe::tasks::components::containers::ConvertToClassificationResult;
|
||||||
using ::mediapipe::tasks::components::containers::proto::ClassificationResult;
|
using ::mediapipe::tasks::components::containers::proto::ClassificationResult;
|
||||||
using ::mediapipe::tasks::core::PacketMap;
|
using ::mediapipe::tasks::core::PacketMap;
|
||||||
|
|
|
@ -38,6 +38,7 @@ namespace image_classifier {
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
using ::mediapipe::NormalizedRect;
|
||||||
using ::mediapipe::api2::Input;
|
using ::mediapipe::api2::Input;
|
||||||
using ::mediapipe::api2::Output;
|
using ::mediapipe::api2::Output;
|
||||||
using ::mediapipe::api2::builder::GenericNode;
|
using ::mediapipe::api2::builder::GenericNode;
|
||||||
|
|
|
@ -54,6 +54,7 @@ constexpr char kGraphTypeName[] =
|
||||||
"mediapipe.tasks.vision.image_embedder.ImageEmbedderGraph";
|
"mediapipe.tasks.vision.image_embedder.ImageEmbedderGraph";
|
||||||
constexpr int kMicroSecondsPerMilliSecond = 1000;
|
constexpr int kMicroSecondsPerMilliSecond = 1000;
|
||||||
|
|
||||||
|
using ::mediapipe::NormalizedRect;
|
||||||
using ::mediapipe::tasks::components::containers::ConvertToEmbeddingResult;
|
using ::mediapipe::tasks::components::containers::ConvertToEmbeddingResult;
|
||||||
using ::mediapipe::tasks::components::containers::proto::EmbeddingResult;
|
using ::mediapipe::tasks::components::containers::proto::EmbeddingResult;
|
||||||
using ::mediapipe::tasks::core::PacketMap;
|
using ::mediapipe::tasks::core::PacketMap;
|
||||||
|
|
|
@ -34,6 +34,7 @@ namespace image_embedder {
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
using ::mediapipe::NormalizedRect;
|
||||||
using ::mediapipe::api2::Input;
|
using ::mediapipe::api2::Input;
|
||||||
using ::mediapipe::api2::Output;
|
using ::mediapipe::api2::Output;
|
||||||
using ::mediapipe::api2::builder::GenericNode;
|
using ::mediapipe::api2::builder::GenericNode;
|
||||||
|
|
|
@ -44,6 +44,7 @@ constexpr int kMicroSecondsPerMilliSecond = 1000;
|
||||||
|
|
||||||
using ::mediapipe::CalculatorGraphConfig;
|
using ::mediapipe::CalculatorGraphConfig;
|
||||||
using ::mediapipe::Image;
|
using ::mediapipe::Image;
|
||||||
|
using ::mediapipe::NormalizedRect;
|
||||||
using ::mediapipe::tasks::vision::image_segmenter::proto::SegmenterOptions;
|
using ::mediapipe::tasks::vision::image_segmenter::proto::SegmenterOptions;
|
||||||
using ImageSegmenterGraphOptionsProto = ::mediapipe::tasks::vision::
|
using ImageSegmenterGraphOptionsProto = ::mediapipe::tasks::vision::
|
||||||
image_segmenter::proto::ImageSegmenterGraphOptions;
|
image_segmenter::proto::ImageSegmenterGraphOptions;
|
||||||
|
|
|
@ -49,6 +49,7 @@ namespace image_segmenter {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
using ::mediapipe::Image;
|
using ::mediapipe::Image;
|
||||||
|
using ::mediapipe::NormalizedRect;
|
||||||
using ::mediapipe::api2::Input;
|
using ::mediapipe::api2::Input;
|
||||||
using ::mediapipe::api2::Output;
|
using ::mediapipe::api2::Output;
|
||||||
using ::mediapipe::api2::builder::Graph;
|
using ::mediapipe::api2::builder::Graph;
|
||||||
|
|
|
@ -57,6 +57,7 @@ constexpr char kSubgraphTypeName[] =
|
||||||
"mediapipe.tasks.vision.ObjectDetectorGraph";
|
"mediapipe.tasks.vision.ObjectDetectorGraph";
|
||||||
constexpr int kMicroSecondsPerMilliSecond = 1000;
|
constexpr int kMicroSecondsPerMilliSecond = 1000;
|
||||||
|
|
||||||
|
using ::mediapipe::NormalizedRect;
|
||||||
using ::mediapipe::tasks::components::containers::ConvertToDetectionResult;
|
using ::mediapipe::tasks::components::containers::ConvertToDetectionResult;
|
||||||
using ObjectDetectorOptionsProto =
|
using ObjectDetectorOptionsProto =
|
||||||
object_detector::proto::ObjectDetectorOptions;
|
object_detector::proto::ObjectDetectorOptions;
|
||||||
|
|
|
@ -52,6 +52,7 @@ namespace vision {
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
using ::mediapipe::NormalizedRect;
|
||||||
using ::mediapipe::api2::Input;
|
using ::mediapipe::api2::Input;
|
||||||
using ::mediapipe::api2::Output;
|
using ::mediapipe::api2::Output;
|
||||||
using ::mediapipe::api2::builder::Graph;
|
using ::mediapipe::api2::builder::Graph;
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
namespace mediapipe {
|
namespace mediapipe {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
using ::mediapipe::NormalizedRect;
|
||||||
using ::testing::FloatNear;
|
using ::testing::FloatNear;
|
||||||
|
|
||||||
class RectangleUtilTest : public testing::Test {
|
class RectangleUtilTest : public testing::Test {
|
||||||
|
|
|
@ -20,6 +20,8 @@ namespace mediapipe {
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
using ::mediapipe::NormalizedRect;
|
||||||
|
|
||||||
// Struct for carrying boundary information.
|
// Struct for carrying boundary information.
|
||||||
struct NormalizedRectBounds {
|
struct NormalizedRectBounds {
|
||||||
float left, right, top, bottom;
|
float left, right, top, bottom;
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
using ::mediapipe::NormalizedRect;
|
||||||
using mediapipe::TrackedDetection;
|
using mediapipe::TrackedDetection;
|
||||||
|
|
||||||
// Checks if a point is out of view.
|
// Checks if a point is out of view.
|
||||||
|
|
|
@ -18,6 +18,8 @@
|
||||||
|
|
||||||
namespace mediapipe {
|
namespace mediapipe {
|
||||||
|
|
||||||
|
using ::mediapipe::NormalizedRect;
|
||||||
|
|
||||||
const float kErrorMargin = 1e-4f;
|
const float kErrorMargin = 1e-4f;
|
||||||
|
|
||||||
TEST(TrackedDetectionTest, ConstructorWithoutBox) {
|
TEST(TrackedDetectionTest, ConstructorWithoutBox) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user