Skip to content

Conversation

@jholveck
Copy link
Contributor

@jholveck jholveck commented Jan 22, 2026

This will detect if a cat is on the screen. By which I mean displayed on the screen, not sitting on your laptop.

This is meant as a simple demo of using MSS for AI. It works as-is, but needs to be documented, and there's some bits that could do with cleanup.

There are a lot of additional features that could be added, such as showing a window with bounding boxes, but that's probably more complexity than is called for here.

Changes proposed in this PR

  • Tests added/updated - N/A
  • Documentation updated
  • Changelog entry added
  • ./check.sh passed - N/A (doesn't check demos)

This will detect if a cat is on the screen.  By which I mean displayed
on the screen, not sitting on your laptop.

This is meant as a simple demo of using MSS for AI.  It works as-is,
but needs to be documented, and there's some bits that could do with
cleanup.

There are a lot of additional features that could be added, such as
showing a window with bounding boxes, but that's probably more
complexity than is called for here.
@BoboTiG
Copy link
Owner

BoboTiG commented Jan 22, 2026

I like it, great inspiration!

Copy link
Contributor

@halldorfannar halldorfannar left a comment

Choose a reason for hiding this comment

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

Excellent PR. Well documented, enjoyable to read. Just some minor improvements suggested.

# Performance
# ===========
#
# The biggest determinant of performance is whether the model runs on a GPU or on the CPU. GPUs are extremely
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we should mention here, right away, that this particular model will work on both? I know this becomes clearer in the end of this section, when GPU vs CPU performance comparisons are discussed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Adding to the next commit

import torchvision.models.detection
import torchvision.transforms.v2

# You'll also need to "pip install mss pillow".
Copy link
Contributor

Choose a reason for hiding this comment

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

Rather than assume the user is leveraging pip (I'm a fan of uv) I would suggest the more general:

Suggested change
# You'll also need to "pip install mss pillow".
# You'll also need to install mss and pillow.

This also aligns with the earlier text where pip is suggested but it is left open for the user how to do this specifically.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I prefer very specific commands in user examples, but I'll make the "pip" command an example rather than sounding like a requirement. I had kind of assumed that the user, if using something other than pip, would know how to adapt the command to their needs.

The reason I pointed the user to the PyTorch "Get Started" page wasn't to handle different package managers; that page still only gives commands for pip (plus building from source, and downloading C++ / Java packages). The main difference for our purposes is that it gives different --index-url flags depending on whether you want a CUDA, ROCm, or CPU-only build.

I'll make a change to soften the suggestion of package manager, but still leave the specific command present.

@jholveck jholveck marked this pull request as ready for review January 28, 2026 07:07
@BoboTiG BoboTiG merged commit e5888a7 into BoboTiG:main Jan 28, 2026
21 checks passed
@jholveck jholveck deleted the feat-demo-cat-detector branch January 28, 2026 12:12
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.

4 participants