Skip to content

Conversation

@penguinland
Copy link
Contributor

Everything compiles, but I haven't tried running it yet. I'll do that while you take a look at the changes...

(doing this now because Alexis got confused why a ticket assigned to me was in her epic)

@penguinland penguinland requested a review from bhaney January 9, 2025 19:00
Copy link
Collaborator

@bhaney bhaney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you create unit tests for 3 cases:

  • An empty valid regions attribute
  • a correct valid regions attribute
  • an incorrect valid regions attribute

You can use the struct directly, you dont have to do the json parsing

CountPeriod float64 `json:"sampling_period_s"`
NSamples int `json:"n_samples"`
ExtraFields map[string]interface{} `json:"extra_fields"`
ValidRegions map[string][]BoundingBoxConfig `json:"valid_regions"`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You'll def want to manually test this on a local machine to see if it works as intended

@penguinland
Copy link
Contributor Author

penguinland commented Jan 24, 2025

Take another look. I've added a bunch of unit tests, and they all pass. I've also gotten this up and working with a webcam on my desk:

{
  "n_samples": 5,
  "chosen_labels": {
    "person": 0.7
  },
  "valid_regions": {
    "cam": [
      {
        "x_max": 1,
        "y_min": 0.5,
        "y_max": 1,
        "x_min": 0
      }
    ]
  },
  "detector_name": "vision-ml-model",
  "count_thresholds": {
    "none": 0,
    "two": 2,
    "three": 3,
    "one": 1
  },
  "sampling_period_s": 5
}

It reads "none" when I duck into the bottom half of the frame, and "one" when I sit up straight in the top half. I can change the Y range to the full 0-1 and the X range to 0-0.5, and it reads "one" when I'm in the left half and "none" when I'm in the right half. Finally, if I set XMax and XMin both to 0, it reads "one" no matter where in the frame I am (and "none" if I'm out of frame)

@penguinland penguinland requested a review from bhaney January 24, 2025 19:37
Copy link
Collaborator

@bhaney bhaney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@penguinland penguinland merged commit c4e6b80 into viam-modules:main Jan 27, 2025
1 check passed
@penguinland penguinland deleted the semantic_config branch January 27, 2025 18:52
penguinland added a commit to penguinland/queue-estimator that referenced this pull request Jan 27, 2025
@penguinland penguinland mentioned this pull request Jan 27, 2025
penguinland added a commit that referenced this pull request Jan 27, 2025
* update readme per PR #7

* tweak the text, too
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants