GithubHelp home page GithubHelp logo

Comments (9)

blakeblackshear avatar blakeblackshear commented on May 15, 2024 2

The mask works by looking at the bottom center of the bounding box for the detected person in the image. If that pixel in the mask is a black pixel, it ignores it as a false positive. In my mask, the grass and driveway visible from my backdoor camera are white. The garage doors, sky, and trees (anywhere it would be impossible for a person to stand) are black.

@jon102034050 If you just omit the mask: property in your yaml config, it should generate an all white one for you on the fly.

@drcrimzon The only reason that line could fail is if OpenCV was unable to read your mask file. Looking at the docs, this is what it says:

If the image cannot be read (because of missing file, improper permissions, unsupported or invalid format), the function returns an empty matrix

I have been saving my file out of Photoshop as a BMP with these settings:
image

from frigate.

blakeblackshear avatar blakeblackshear commented on May 15, 2024 1

Thanks. I will fix that in the next release.

from frigate.

JonGilmore avatar JonGilmore commented on May 15, 2024

I had this same stack trace. Does your mask file exist for all of your cameras?

see this issue: #29

from frigate.

drcrimzon avatar drcrimzon commented on May 15, 2024

My masks are there, is there a specific bitmap format they are supposed to be in? I just created a WxH sized image in gimp and exported as bmp. I verified permissions, and triple checked config, it looks correct.

from frigate.

drcrimzon avatar drcrimzon commented on May 15, 2024

Well, I recreated the masks with a gray scale bitmap, which dropped the size from 7MB to 2MB, this solved the crash it appears.

from frigate.

drcrimzon avatar drcrimzon commented on May 15, 2024

Well, it crashed again with the 2MB bitmaps, I created 500k ones using imagemagick:
convert -size 2560x1440 -colors 254 xc:white mask.bmp, which looks like it's working so far.

Not sure if it's still an issue, If I remove the mask from the config, it looks like the code is supposed to create one on the fly, but that generates an error currently.

I'll let this run over night and see if it is really fixed, and then take a look at the auto create tomorrow.

from frigate.

JonGilmore avatar JonGilmore commented on May 15, 2024

fwiw, my mask is literally just a white bmp, and its around 4.5MB and I've had no issues. I'll be perfectly honest though and say that I don't know much about how the masks work, and it doesn't seem to be really well documented (yet).

from frigate.

drcrimzon avatar drcrimzon commented on May 15, 2024

Those are the settings, I was using. The container ran overnight with the new bmp i generated with convert.

I also tried omitting mask, but that resulted in an error trying to execute np.zeros in the generation of the mask. I'll try it again and post the exact error.

from frigate.

drcrimzon avatar drcrimzon commented on May 15, 2024

@blakeblackshear, I went back and removed the mask from my config. The error was np not defined. Checked and video.py is missing numpy.
Added
import numpy as np and rebuilt, and it resolved the auto mask creation.

from frigate.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.