Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tracker: Remove objects that are no longer detected #5

Open
wants to merge 1 commit into
base: gimlet
Choose a base branch
from
Open
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 @@ -34,7 +34,7 @@ namespace {

using ::mediapipe::NormalizedRect;

constexpr int kDetectionUpdateTimeOutMS = 5000;
constexpr int kDetectionUpdateTimeOutMS = 1000;
constexpr char kDetectionsTag[] = "DETECTIONS";
constexpr char kDetectionBoxesTag[] = "DETECTION_BOXES";
constexpr char kDetectionListTag[] = "DETECTION_LIST";
Expand Down Expand Up @@ -268,11 +268,6 @@ absl::Status TrackedDetectionManagerCalculator::Process(CalculatorContext* cc) {

for (const auto& detection_ptr : all_detections) {
const auto& detection = *detection_ptr.second;
// Only output detections that are synced.
if (detection.last_updated_timestamp() <
cc->InputTimestamp().Microseconds() / 1000) {
continue;
}
output_detections->emplace_back(
GetAxisAlignedDetectionFromTrackedDetection(detection));
output_boxes->emplace_back(detection.bounding_box());
Expand Down
1 change: 0 additions & 1 deletion mediapipe/util/tracking/tracked_detection_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ std::vector<int> TrackedDetectionManager::UpdateDetectionLocation(
}
auto& detection = *detection_ptr->second;
detection.set_bounding_box(bounding_box);
detection.set_last_updated_timestamp(timestamp);

// It's required to do this here in addition to in AddDetection because during
// fast motion, two or more detections of the same object could coexist since
Expand Down