Local realtime person detection for RTSP cameras

I’ve started with an hassio addon. It was not as complicated as I thought.
There is no need for the priviliged mode, mapping /dev/bus/usb as a device was enough for the container to “see” the coral device
(something like this https://docs.docker.com/compose/compose-file/compose-file-v2/#devices)

A minor change was needed for the config folder. Hassio exposes the HA configuration folder as /config in the container. In my HA config folder I have subfolder frigate so the detect_objects.py had to look for /config/frigate/config.yml

For now the addon is nothing more than two files.
A Dockerfile which uses the image build by blakeblackshear and modifies a file with SED and adds an environment variable FRIGATE_RTSP_PASSWORD

Any thoughts on this ?

1 Like

Hi,

Someone have some performance data using frigate+google coral ?

For example, for person detection, how many fps can process a setup with 1080p camera?

Thanks!

I really hope privileged mode is no longer required. That would be fantastic. You will also need to pass the devices to enable ffmpeg to use hardware acceleration when decoding (/dev/dri/renderD128) if you want that. Unfortunately, HassOS does not include the kernel flags for hardware accelerated decoding, so it won’t work there. I can update frigate to look for an environment variable that specifies the location of the config file.

It depends on a lot of variables, but the Coral can process over 100 300x300 images per second. You could look in at least 10 different locations of a 1080p camera at 10fps.

Caught it in process, Blake. Here’s the log and the output of debug/stats:

RegionPrepper: frame_time not in frame_cache
RegionPrepper: frame_time not in frame_cache
RegionPrepper: frame_time not in frame_cache
RegionPrepper: frame_time not in frame_cache
RegionPrepper: frame_time not in frame_cache
RegionPrepper: frame_time not in frame_cache
RegionPrepper: frame_time not in frame_cache
RegionPrepper: frame_time not in frame_cache
RegionPrepper: frame_time not in frame_cache
RegionPrepper: frame_time not in frame_cache
RegionPrepper: frame_time not in frame_cache
RegionPrepper: frame_time not in frame_cache
RegionPrepper: frame_time not in frame_cache
RegionPrepper: frame_time not in frame_cache
RegionPrepper: frame_time not in frame_cache
RegionPrepper: frame_time not in frame_cache
RegionPrepper: frame_time not in frame_cache
RegionPrepper: frame_time not in frame_cache
RegionPrepper: frame_time not in frame_cache
RegionPrepper: frame_time not in frame_cache
RegionPrepper: frame_time not in frame_cache
RegionPrepper: frame_time not in frame_cache
RegionPrepper: frame_time not in frame_cache
RegionPrepper: frame_time not in frame_cache
RegionPrepper: frame_time not in frame_cache
RegionPrepper: frame_time not in frame_cache
RegionPrepper: frame_time not in frame_cache
RegionPrepper: frame_time not in frame_cache
RegionPrepper: frame_time not in frame_cache
RegionPrepper: frame_time not in frame_cache
RegionPrepper: frame_time not in frame_cache
RegionPrepper: frame_time not in frame_cache
RegionPrepper: frame_time not in frame_cache
RegionPrepper: frame_time not in frame_cache
RegionPrepper: frame_time not in frame_cache
RegionPrepper: frame_time not in frame_cache
RegionPrepper: frame_time not in frame_cache
RegionPrepper: frame_time not in frame_cache
RegionPrepper: frame_time not in frame_cache
RegionPrepper: frame_time not in frame_cache
RegionPrepper: frame_time not in frame_cache
RegionPrepper: frame_time not in frame_cache
RegionPrepper: frame_time not in frame_cache
RegionPrepper: frame_time not in frame_cache
RegionPrepper: frame_time not in frame_cache
RegionPrepper: frame_time not in frame_cache
RegionPrepper: frame_time not in frame_cache
RegionPrepper: frame_time not in frame_cache
RegionPrepper: frame_time not in frame_cache
RegionPrepper: frame_time not in frame_cache
RegionPrepper: frame_time not in frame_cache
Exception in thread Thread-13:
Traceback (most recent call last):
  File "/usr/lib/python3.5/threading.py", line 914, in _bootstrap_inner
    self.run()
  File "/opt/frigate/frigate/objects.py", line 98, in run
    self.camera.regions_in_process[frame['frame_time']] -= 1
KeyError: 1579200477.432628
{"coral":{"fps":7.1,"inference_speed":8.177437028815476,"queue_length":0},"doorbellcam":{"camera_fps":1.0,"dynamic_regions_per_sec":0.0,"finished_frame_queue":0,"frame_queue":2786,"refined_frame_queue":0,"regions_in_process":{"1579200469.391367":1,"1579200470.499336":1,"1579200477.582365":2,"1579200477.739145":2,"1579200477.765739":2,"1579200477.96867":2,"1579200478.000585":2,"1579200478.155197":2,"1579200478.305544":2,"1579200478.451537":2,"1579200478.599672":2,"1579200478.615104":2,"1579200478.772389":2,"1579200478.925041":2,"1579200479.084686":2,"1579200479.239562":2,"1579200479.262867":2,"1579200479.399867":2,"1579200479.556592":2,"1579200479.719005":2,"1579200479.872723":2,"1579200479.890216":2,"1579200480.033905":2,"1579200480.131388":2,"1579200480.300628":2,"1579200480.421715":2,"1579200480.542687":2,"1579200480.639512":2,"1579200480.760227":2,"1579200480.879745":2,"1579200480.999421":2,"1579200481.120721":2,"1579200481.249852":2,"1579200481.369818":2,"1579200481.490123":2,"1579200481.624941":2,"1579200481.782042":2,"1579200481.902259":2,"1579200482.02225":2,"1579200482.1416":2,"1579200482.262862":2,"1579200482.386277":2,"1579200482.520072":2,"1579200482.648663":2,"1579200482.768432":2,"1579200482.888601":2,"1579200483.009658":2,"1579200483.127914":2,"1579200483.297866":2,"1579200483.418189":2,"1579200483.537013":2,"1579200483.680227":2,"1579200483.761537":2,"1579200483.883533":2,"1579200483.999907":2,"1579200484.128822":2,"1579200484.250496":2,"1579200484.370129":2,"1579200484.490384":2,"1579200484.618741":2,"1579200484.779643":2,"1579200484.903144":2,"1579200485.022525":2,"1579200485.200372":2,"1579200485.274404":2,"1579200485.382163":2,"1579200485.500292":2,"1579200485.633622":2,"1579200485.750564":2,"1579200485.868936":2,"1579200485.990056":2,"1579200486.330309":2,"1579200486.431158":2,"1579200486.519419":2,"1579200486.658441":2,"1579200486.777885":2,"1579200486.898018":2,"1579200487.017455":2,"1579200487.165656":2,"1579200487.628078":2,"1579200488.649628":2,"1579200489.639433":2,"1579200490.639707":2,"1579200491.648403":2,"1579200492.6389":2,"1579200493.629612":2,"1579200494.64956":2,"1579200495.639274":2,"1579200496.629011":2,"1579200497.660626":2,"1579200498.669446":2,"1579200499.629069":2,"1579200500.649001":2,"1579200501.639355":2,"1579200502.618923":2,"1579200503.672305":2,"1579200504.658863":2,"1579200505.629242":2,"1579200506.649743":2,"1579200507.680684":2,"1579200508.628888":2,"1579200509.648803":2,"1579200510.639523":2,"1579200511.628869":2,"1579200512.649012":2,"1579200513.679936":2,"1579200514.628435":2,"1579200515.649401":2,"1579200516.640337":2,"1579200517.657201":2,"1579200518.648893":2,"1579200519.679763":2,"1579200520.628219":2,"1579200521.649599":2,"1579200522.668837":2,"1579200523.629663":2,"1579200524.648299":2,"1579200525.67041":2,"1579200526.618791":2,"1579200527.631286":2,"1579200528.658303":2,"1579200529.629698":2,"1579200530.649566":2,"1579200531.639279":2,"1579200532.619131":2,"1579200533.672921":2,"1579200534.660269":2,"1579200535.629915":2,"1579200536.649558":2,"1579200537.681094":2,"1579200538.629761":2,"1579200539.64994":2,"1579200540.639524":2,"1579200541.628738":2,"1579200542.649809":2,"1579200543.680621":2,"1579200544.619149":2,"1579200545.673846":2,"1579200546.660058":2,"1579200547.629632":2,"1579200548.649904":2,"1579200549.659553":2,"1579200550.629233":2,"1579200551.039311":2,"1579200551.64958":2,"1579200552.68009":2,"1579200553.629901":2,"1579200554.649631":2,"1579200555.680806":2,"1579200556.630011":2,"1579200557.648996":2,"1579200558.680294":2,"1579200559.630044":2,"1579200560.649145":2,"1579200561.640973":2,"1579200562.629159":2,"1579200563.650594":2,"1579200564.640899":2,"1579200565.630217":2,"1579200566.650071":2,"1579200567.682145":2,"1579200568.629403":2,"1579200569.650223":2,"1579200570.640843":2,"1579200571.630159":2,"1579200572.650509":2,"1579200573.670192":2,"1579200574.619708":2,"1579200575.631138":2,"1579200576.659898":2,"1579200577.630223":2,"1579200578.649651":2,"1579200579.640905":2,"1579200580.630224":2,"1579200581.650231":2,"1579200582.681797":2,"1579200583.62925":2,"1579200584.649394":2,"1579200585.680465":2,"1579200586.620664":2,"1579200587.669232":2,"1579200588.660487":2,"1579200589.630709":2,"1579200590.650655":2,"1579200591.640499":2,"1579200592.619584":2,"1579200593.67432":2,"1579200594.680035":2,"1579200595.630128":2,"1579200596.651358":2,"1579200597.670076":2,"1579200598.629929":2,"1579200599.649698":2,"1579200600.670743":2,"1579200601.629548":2,"1579200602.650551":2,"1579200603.681598":2,"1579200604.629901":2,"1579200605.65034":2,"1579200606.657035":2,"1579200607.630078":2,"1579200608.650123":2,"1579200609.681594":2,"1579200610.629842":2,"1579200611.650508":2,"1579200612.640969":2,"1579200613.647006":2,"1579200614.651063":2,"1579200615.681428":2,"1579200616.63114":2,"1579200617.65099":2,"1579200618.641497":2,"1579200619.630538":2,"1579200620.650652":2,"1579200621.670999":2,"1579200622.616322":2,"1579200623.636008":2,"1579200624.660322":2,"1579200625.630832":2,"1579200626.650152":2,"1579200627.641753":2,"1579200628.630657":2,"1579200629.650259":2,"1579200630.64194":2,"1579200631.623734":2,"1579200632.636311":2,"1579200633.685688":2,"1579200634.623583":2,"1579200635.675579":2,"1579200636.660283":2,"1579200637.630985":2,"1579200638.651186":2,"1579200639.640912":2,"1579200640.630883":2,"1579200641.650621":2,"1579200642.641867":2,"1579200643.631404":2,"1579200644.530275":2,"1579200644.650976":2,"1579200644.770129":2,"1579200645.322041":2,"1579200645.419625":2,"1579200645.670445":2,"1579200646.630493":2,"1579200647.651382":2,"1579200648.671203":2,"1579200649.631412":2,"1579200650.650927":2,"1579200651.682752":2,"1579200652.630063":2,"1579200653.65147":2,"1579200654.641612":2,"1579200655.630844":2,"1579200656.631648":2,"1579200657.671922":2,"1579200658.621202":2,"1579200659.633218":2,"1579200660.660963":2,"1579200661.631364":2,"1579200662.6511":2,"1579200663.681957":2,"1579200664.63149":2,"1579200665.651102":2,"1579200666.682185":2,"1579200667.631269":2,"1579200668.65148":2,"1579200669.671302":2,"1579200670.63113":2,"1579200671.651007":2,"1579200672.671277":2,"1579200673.630947":2,"1579200674.651686":2,"1579200675.641803":2,"1579200676.630835":2,"1579200677.651553":2,"1579200678.642097":2,"1579200679.630636":2,"1579200680.660943":2,"1579200681.642063":2,"1579200682.631418":2,"1579200683.650836":2,"1579200684.642676":2,"1579200685.631206":2,"1579200686.652004":2,"1579200687.660898":2,"1579200688.650492":2,"1579200689.651978":2,"1579200690.66141":2,"1579200691.620838":2,"1579200692.634324":2,"1579200693.661804":2,"1579200694.630751":2,"1579200695.652269":2,"1579200696.671381":2,"1579200697.647804":2,"1579200698.652066":2,"1579200699.642208":2,"1579200700.631347":2,"1579200701.67129":2,"1579200702.660776":2,"1579200703.630703":2,"1579200704.650415":2,"1579200705.641901":2,"1579200706.62164":2,"1579200707.675389":2,"1579200708.661642":2,"1579200709.631459":2,"1579200710.652257":2,"1579200711.642505":2,"1579200712.631635":2,"1579200713.652531":2,"1579200714.663229":2,"1579200715.631585":2,"1579200716.652126":2,"1579200717.670764":2,"1579200718.626878":2,"1579200719.673857":2,"1579200720.666131":2,"1579200721.618025":2,"1579200722.674511":2,"1579200723.661774":2,"1579200724.632222":2,"1579200725.651152":2,"1579200726.642553":2,"1579200727.646345":2,"1579200728.650788":2,"1579200729.642597":2,"1579200730.63168":2,"1579200731.651354":2,"1579200732.642327":2,"1579200733.631977":2,"1579200734.65213":2,"1579200735.652211":2,"1579200736.62115":2,"1579200737.67592":2,"1579200738.66124":2,"1579200739.648841":2,"1579200740.652316":2,"1579200741.674986":2,"1579200742.631351":2,"1579200743.651698":2,"1579200744.672052":2,"1579200745.646031":2,"1579200746.651695":2,"1579200747.6421":2,"1579200748.632178":2,"1579200749.652329":2,"1579200750.67343":2,"1579200751.631347":2,"1579200752.65184":2,"1579200753.683092":2,"1579200754.631384":2,"1579200755.651377":2,"1579200756.642048":2,"1579200757.621032":2,"1579200758.671526":2,"1579200759.661103":2,"1579200760.630752":2,"1579200761.651541":2,"1579200762.67118":2,"1579200763.61522":2,"1579200764.674712":2,"1579200765.661475":2,"1579200766.630871":2,"1579200767.652456":2,"1579200768.675769":2,"1579200769.631227":2,"1579200770.651493":2,"1579200771.642214":2,"1579200772.648366":2,"1579200773.651915":2,"1579200774.66172":2,"1579200775.632215":2,"1579200776.641696":2,"1579200777.663619":2,"1579200778.142191":2,"1579200778.639361":2,"1579200779.651945":2,"1579200780.68256":2,"1579200781.632149":2,"1579200782.652556":2,"1579200783.68246":2,"1579200784.632217":2,"1579200785.652307":2,"1579200786.643062":2,"1579200787.631994":2,"1579200788.651982":2,"1579200789.675085":2,"1579200790.632684":2,"1579200791.651716":2,"1579200792.671887":2,"1579200793.621624":2,"1579200794.632923":2,"1579200795.661786":2,"1579200796.631431":2,"1579200797.651503":2,"1579200798.661606":2,"1579200799.632145":2,"1579200800.651532":2,"1579200801.661355":2,"1579200802.632141":2,"1579200803.651941":2,"1579200804.661176":2,"1579200805.65715":2,"1579200806.65267":2,"1579200807.661493":2,"1579200808.667117":2,"1579200809.652731":2,"1579200810.661917":2,"1579200811.64076":2,"1579200812.651881":2,"1579200813.661664":2,"1579200814.632315":2,"1579200815.652062":2,"1579200816.676515":2,"1579200817.63247":2,"1579200818.651983":2,"1579200819.643832":2,"1579200820.632761":2,"1579200821.652663":2,"1579200822.64381":2,"1579200823.633008":2,"1579200824.65342":2,"1579200825.643491":2,"1579200826.633284":2,"1579200827.65255":2,"1579200828.663155":2,"1579200829.632683":2,"1579200830.653197":2,"1579200831.643779":2,"1579200832.633413":2,"1579200833.654052":2,"1579200834.644054":2,"1579200835.633013":2,"1579200836.653465":2,"1579200837.644402":2,"1579200838.633563":2,"1579200839.652655":2,"1579200840.673917":2,"1579200841.633996":2,"1579200842.65411":2,"1579200843.673216":2,"1579200844.633669":2,"1579200845.654021":2,"1579200846.664363":2,"1579200847.634332":2,"1579200848.65417":2,"1579200849.133782":2,"1579200849.543367":2,"1579200849.664259":2,"1579200850.383825":2,"1579200850.66231":2,"1579200851.653832":2,"1579200852.644953":2,"1579200853.635087":2,"1579200854.404139":2,"1579200854.654928":2,"1579200855.645798":2,"1579200856.633853":2,"1579200857.655497":2,"1579200858.645916":2,"1579200859.635121":2,"1579200860.645813":2,"1579200861.526165":2,"1579200861.665058":2,"1579200862.503515":2,"1579200862.634535":2,"1579200863.675112":2,"1579200864.665862":2,"1579200865.628165":2,"1579200866.638883":2,"1579200867.664589":2,"1579200868.634649":2,"1579200869.655572":2,"1579200870.664577":2,"1579200871.635817":2,"1579200872.655856":2,"1579200873.665343":2,"1579200874.636401":2,"1579200875.655517":2,"1579200876.135591":2,"1579200876.455223":2,"1579200876.686634":2,"1579200877.267855":2,"1579200877.636137":2,"1579200878.292167":2,"1579200878.656239":2,"1579200878.775209":2,"1579200879.135725":2,"1579200879.304986":2,"1579200879.545311":2,"1579200879.670086":2,"1579200879.785035":2,"1579200880.024595":2,"1579200880.176221":2,"1579200880.265367":2,"1579200880.635787":2,"1579200880.805349":2,"1579200881.065733":2,"1579200881.285043":2,"1579200881.550343":2,"1579200881.675894":2,"1579200881.757643":2,"1579200881.877194":2,"1579200881.997688":2,"1579200882.118084":2,"1579200882.317646":2,"1579200882.444895":2,"1579200882.527923":2,"1579200882.676237":2,"1579200882.785128":2,"1579200882.905486":2,"1579200883.045378":2,"1579200883.26567":2,"1579200883.385099":2,"1579200883.504892":2,"1579200883.636247":2,"1579200883.805602":2,"1579200883.925451":2,"1579200884.060915":2,"1579200884.185249":2,"1579200884.285494":2,"1579200884.405159":2,"1579200884.526769":2,"1579200884.656177":2,"1579200884.774932":2,"1579200884.896073":2,"1579200885.016369":2,"1579200885.136198":2,"1579200885.310089":2,"1579200885.425283":2,"1579200885.544735":2,"1579200885.666007":2,"1579200885.785342":2,"1579200885.905674":2,"1579200886.026059":2,"1579200886.145237":2,"1579200886.266182":2,"1579200886.406118":2,"1579200886.525505":2,"1579200886.635476":2,"1579200886.805776":2,"1579200886.925799":2,"1579200887.045103":2,"1579200887.196352":2,"1579200887.316429":2,"1579200887.405205":2,"1579200887.525359":2,"1579200887.65597":2,"1579200887.775673":2,"1579200887.895393":2,"1579200888.01561":2,"1579200888.136071":2,"1579200888.304781":2,"1579200888.454637":2,"1579200888.550924":2,"1579200888.675":2,"1579200888.768119":2,"1579200888.887625":2,"1579200889.00729":2,"1579200889.12787":2,"1579200889.257274":2,"1579200889.377277":2,"1579200889.496924":2,"1579200889.627027":2,"1579200889.7869":2,"1579200889.907155":2,"1579200890.027788":2,"1579200890.147956":2,"1579200890.267943":2,"1579200890.387362":2,"1579200890.507953":2,"1579200890.680499":2,"1579200890.75749":2,"1579200890.877861":2,"1579200890.997953":2,"1579200891.118765":2,"1579200891.317836":2,"1579200891.42142":2,"1579200891.526995":2,"1579200891.665957":2,"1579200891.786421":2,"1579200891.905588":2,"1579200892.025579":2,"1579200892.145697":2,"1579200892.26585":2,"1579200892.386016":2,"1579200892.50944":2,"1579200892.663947":2,"1579200892.80728":2,"1579200892.926044":2,"1579200893.048496":2,"1579200893.165771":2,"1579200893.285828":2,"1579200893.420016":2,"1579200893.55206":2,"1579200893.636528":2,"1579200893.758673":2,"1579200893.884609":2,"1579200893.999014":2,"1579200894.120454":2,"1579200894.30831":2,"1579200894.414654":2,"1579200894.52856":2,"1579200894.666184":2,"1579200894.785575":2,"1579200894.905639":2,"1579200895.025617":2,"1579200895.145421":2,"1579200895.266963":2,"1579200895.386006":2,"1579200895.536635":2,"1579200895.701476":2,"1579200895.817787":2,"1579200895.907524":2,"1579200896.028029":2,"1579200896.148706":2,"1579200896.267682":2,"1579200896.412727":2,"1579200896.528273":2,"1579200896.637877":2,"1579200896.800432":2,"1579200896.908608":2,"1579200896.998841":2,"1579200897.117812":2,"1579200897.35227":2,"1579200897.407396":2,"1579200897.528242":2,"1579200897.691876":2,"1579200897.806406":2,"1579200897.905433":2,"1579200898.026039":2,"1579200898.146166":2,"1579200898.288902":2,"1579200898.386741":2,"1579200898.534132":2,"1579200898.646551":2,"1579200898.806724":2,"1579200898.948155":2,"1579200899.071171":2,"1579200899.166043":2,"1579200899.285834":2,"1579200899.405822":2,"1579200899.526035":2,"1579200899.656143":2,"1579200899.776286":2,"1579200900.015763":2,"1579200900.556001":2,"1579200900.647173":2,"1579200901.007534":2,"1579200901.258738":2,"1579200901.499222":2,"1579200901.636853":2,"1579200901.806172":2,"1579200902.166497":2,"1579200902.668639":2,"1579200903.426307":2,"1579200903.688171":2,"1579200904.1372":2,"1579200904.626222":2,"1579200905.680719":2,"1579200906.666822":2,"1579200907.637278":2,"1579200908.645999":2,"1579200909.66718":2,"1579200910.63687":2,"1579200911.6777":2,"1579200912.66652":2,"1579200913.637315":2,"1579200914.65758":2,"1579200915.649388":2,"1579200916.654685":2,"1579200917.657487":2,"1579200918.667937":2,"1579200919.637812":2,"1579200920.657456":2,"1579200921.648569":2,"1579200922.6281":2,"1579200923.153085":2,"1579200923.681295":2,"1579200924.668143":2,"1579200925.638103":2,"1579200926.65859":2,"1579200927.689702":2,"1579200928.637859":2,"1579200929.658732":2,"1579200930.650195":2,"1579200931.638784":2,"1579200932.658911":2,"1579200933.650746":2,"1579200934.638298":2,"1579200935.64796":2,"1579200936.672309":2,"1579200937.638819":2,"1579200938.658164":2,"1579200939.649529":2,"1579200940.639392":2,"1579200941.658384":2,"1579200942.650529":2,"1579200943.655908":2,"1579200944.659414":2,"1579200945.649594":2,"1579200946.639234":2,"1579200947.658621":2,"1579200948.673204":2,"1579200949.629436":2,"1579200950.683404":2,"1579200951.669588":2,"1579200952.65592":2,"1579200953.659275":2,"1579200954.679582":2,"1579200955.621275":2,"1579200956.684172":2,"1579200957.669056":2,"1579200958.639363":2,"1579200959.659507":2,"1579200960.670178":2,"1579200961.629825":2,"1579200962.64025":2,"1579200963.669541":2,"1579200964.639066":2,"1579200965.660072":2,"1579200966.65189":2,"1579200967.629533":2,"1579200968.641643":2,"1579200969.669911":2,"1579200970.640509":2,"1579200971.659849":2,"1579200972.651078":2,"1579200973.640557":2,"1579200974.66071":2...................,"1579202648.688628":2,"1579202649.683498":2,"1579202650.823569":2},"resize_queue":0,"skipped_regions_per_sec":0.0},"drivewaycam":{"camera_fps":0.9,"dynamic_regions_per_sec":0.0,"finished_frame_queue":0,"frame_queue":0,"refined_frame_queue":0,"regions_in_process":{},"resize_queue":0,"skipped_regions_per_sec":0.0},"frontcam":{"camera_fps":1.1333333333333333,"dynamic_regions_per_sec":0.0,"finished_frame_queue":0,"frame_queue":0,"refined_frame_queue":0,"regions_in_process":{},"resize_queue":0,"skipped_regions_per_sec":0.0}}

I had to truncate the JSON string because it exceeded the allowable post character count.

No problem. It is exactly what I suspected. Those are great inference speeds. What hardware are you running on?

For anyone using Hassio on amd64 platform (For example the Celeron NUC I’m running on)
You can add the following URL as a repository https://github.com/mories76/ha-addon-frigate
It might work :wink: I am not a developer, no prior github experience.

@blakeblackshear a parameter CONFIG_FILE or something like that would work fine. I’ve added the /dev/dri/renderD128

2 Likes

I’ll try it when I can

The hardware is an older Dell Optiplex i5 at 3.4ghz. Works great for HA and pretty much anything else I’ve thrown at it.

The blakeblackshear/frigate:dev image works great with HW Accel now!

I do notice that my min_area isn’t being filtered though for a person.

EDIT: It looks like it is filtering… But it’s also sending notifications for ones that are below the threshold?

I think this is happening.

When I choose not to fill out the global config, the debug screen shows it tagging all objects.

Since I have a notification set up to detect a person, it pushes that notification and is ignoring the camera specific filtering in the yaml.

So this config is missing the optional global objects, so it tags all objects and sends notifications for people? I think that’s why this is happening to me.

cameras:
  front_window:
    ffmpeg:
      input: REDACTED
    take_frame: 2
    objects:
      track:
        - person
      filters:
        person:         
          min_area: 235000
          max_area: 3686400
          threshold: 0.8          
    regions:
      - size: 1920
        x_offset: 0
        y_offset: 0

I an effort to stop editing my post, I’ll summarize.

This does not correctly filter:

cameras:
  front_window:
    ffmpeg:
      input: REDACTED
    take_frame: 2
    objects:
      track:
        - person
      filters:
        person:         
          min_area: 235000
          max_area: 3686400
          threshold: 0.8          
    regions:
      - size: 1920
        x_offset: 0
        y_offset: 0

This does correctly filter (but at the cost of removing all non-persons from the debug view:

objects:
  track:
    - person

cameras:
  front_window:
    ffmpeg:
      input: REDACTED
    take_frame: 2
    objects:
      track:
        - person
      filters:
        person:         
          min_area: 235000
          max_area: 3686400
          threshold: 0.8          
    regions:
      - size: 1920
        x_offset: 0
        y_offset: 0

Im not sure I understand what you mean by “but at the cost of removing all non-persons from the debug view”. Only tracked objects are shown in the debug view now. It doesn’t waste time tracking objects that aren’t listed.

In the first example you posted, I would expect it to track person, car, and truck objects and apply the filters for size and threshold to the person object on the front_window camera. Specifying person under track on the camera would have no effect, because the global default already includes person.

In the second example, I would expect frigate to only look for person objects across all cameras. Again, specifying person under track on the camera would have no effect, because the global default already includes person.

I am starting to think that the way I am merging tracked objects is too confusing.

I pushed up a new version of the beta image that might fix the issue @hawkeye217 and @billimek are running into. It also addresses the HW accell issues that @Kyle was having.

2 Likes

I’ll give it a go and let you know. Thanks @blakeblackshear!

Ah. I was under the impression that the MJPEG debugging stream would show all objects (even those not tracked) to aid with debugging. No worries if it isn’t.

What I’m seeing in my second example (posted again below) is that if I don’t include the global rule at the top of my config, the filters in the camera aren’t working. Specifically, I couldn’t get the min_area to work inside the camera config unless I declared it

After pulling your latest 0.4.0-beta image (sha256-a1219fac2320c10d58fec39723eed4d4da61302c6f1569161c1dad481f167f67) it looks like the filter issue is no longer a problem. :man_shrugging: It’s either fixed or I had a problem with my config this morning.

Thanks for updating the beta to fix the VAPI! HW Accel is working great again on the latest beta. :slight_smile:

Hi guys,
Was cpu (non coral) support included in the latest version?

Not yet. It will be available soon.

Sorry for the late reply!

Both frigate and motion are configured to receive the camera feed via rtsp.

In home assistant I have this binary_sensor for the mqtt topic that frigate publishes to

  - name: Person Front Yard
    platform: mqtt
    state_topic: "frigate/front/person"
    device_class: motion
    availability_topic: "frigate/available"

I then have two automations that trigger from the state changes of that binary sensor. These automations call a shell command action to toggle the motion of motioneye to on or off.

in my automations.yaml, configured through the ui editor

- id: '1576636282260'
  alias: Start motion capture
  description: Starts capture on motion eyebased on person sensor
  trigger:
  - entity_id: binary_sensor.person_front_yard
    from: 'off'
    platform: state
    to: 'on'
  condition: []
  action:
  - service: shell_command.motion_on
- id: '1576636379494'
  alias: Stop motion capture
  description: Stops capture on motion eyebased on person sensor
  trigger:
  - entity_id: binary_sensor.person_front_yard
    from: 'on'
    platform: state
    to: 'off'
  condition: []
  action:
  - service: shell_command.motion_off

from configuration.yaml

shell_command:
  motion_on: curl http://<motioneyeip>:7999/2/config/set?emulate_motion=on
  motion_off: curl http://<motioneyeip>:7999/2/config/set?emulate_motion=off

For motioneye I only have videos enabled (other than the required sections at the top). I’ve found that I can configure the motion detection section how I want it to behave, then I turn off the motion setting. I also mask out the entire screen in motion so that its motion detection does not fire on its own. The mask may not be necessary but I swear I was seeing it intervene. Even though motion is disabled, the shell command above will trigger ‘motion detected’ and it will record video with the settings (pre/post frames)

note, the 7999 is the motioneye api port, i had to enable remote control in the motion.conf file. See here

When you navigate the web ui you’ll see the structure, i.e the /2/ above is the camera id.

This has been pretty stable. I’m using a wyze cam w/ the dafang hacks and it’s a bit flakey. I have some todo’s like consolidate the automations to a single one, get more/better cameras, etc but otherwise I’m pretty happy with it.

I’m running the latest image you pushed and there was some activity on my camera, so I just went to check the frigate logs and saw about 15 of these:

RegionPrepper: frame_time not in frame_cache

No memory leak or restarting yet, though. And the debug output is clean with 0 frames in the queue, unlike earlier.

That message doesn’t necessarily indicate a problem. It means frigate was still trying to refine object tracking on that frame, but the image expired from the cache because it was too old. It is how I tell frigate to give up and move on because it should be looking at a more recent frame. As long as it isn’t causing your queues to fill up, it should be fine.