-
-
Notifications
You must be signed in to change notification settings - Fork 94
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
Using http snapshot image #102
Comments
I did a little digging into your code and found this as well. I'm still not 100% sure how the http snapshot feature works, but ideally I'd just like to replace the frigate snapshot url with my camera's snapshot url and have Double Take do all the same work behind the scenes as if it got its image from frigate. Is that basically what the |
Hey there! Yes, I think the cameras config is what you're looking for. Would something like this work for you? The below config will allow you to hit cameras:
driveway:
snapshot:
url: http://your-image-url.com/image.jpg |
Seems like that's what I was looking for! I'll give it a try. Thanks David! |
Glad to hear! Let me know if you run into any issues. |
So I've got a folder with a bunch of subfolders named with each individual already populated with images from my existing setup. I just moved those subfolders over to the |
Right now you would have to go to the "Train" tab on the UI and click the "sync" button for each person you want to train. There isn't a way to do this across all users at the moment. I can try to add in support for this if you think it would be useful. |
No problem. Just wrote a little bash script to do it via your api. Seems to be working at the moment! EDIT: It didn't work. I've got a fair number of people to train (75 to be exact) and about 3-4 images per person. It seems to be stretching the limits of the Vue interface without pagination or any kind of filtering. It takes a while to load everything on the Train page. What might be helpful is some sort of filter to show trained vs untrained images - I'd love to be able to navigate to the Train page and only see untrained images as the default so I can move and train them more quickly. Thanks for the great work on this! |
Actually, I guess I'm still learning how it works. I noticed the Match screen already has a bunch of filters. I'll keep playing around! |
I just got pagination added to the matches page, so I can focus on getting that added on the training page too. That should help with the page load time. I'll let you know when I get that added in. I'll try to start on it tonight. That's a lot of people to train! What's your use case if you don't mind me asking? Thank you again for the kind works and for taking the time to try this project out. If you have any other questions or feature suggestions, let me know! |
Sounds great! My use case is more for fun than anything. Over the last couple of years I've taken snapshots of friends, family, and neighbors when they've rung my doorbell. I have an automation that makes a TTS announcement with their name when any one of them rings the bell again and their face is detected. I've got everything set up at the moment and will let it run over the next few days to see how it works. Thanks! |
Looks like I'm running into a similar issue to this one that you've been discussing today: #101 My high-res snapshot url is being scaled down to a height of 500px rather than using the full resolution. Will explicitly setting the Edit: I set the height parameter and it does look like it's working, but the image quality is severely degraded from what the direct snapshot url image looks like. |
Is the degraded image just on the matches page in the thumbnail? I scale down and reduce the quality on those thumbnails to speed up the page load. If you click the button in the top right of the image it should open the source image used in a new tab. |
I just pushed a new beta build that allows you to adjust the quality of those thumbnail images on the UI if desired. And I added pagination to the training page. So hopefully that speeds up your load times! Let me know if it works for you. # ui settings (default: shown below)
ui:
pagination:
# number of results per page
limit: 50
thumbnails:
# value between 0-100
quality: 80
# value in pixels
width: 300 https://github.com/jakowenko/double-take/tree/beta#ui-1 |
I saw your code that reduces the thumbnail size to 70% quality. Clicking the button on the top right of the image brings up the source image, but it's 500px in height if I don't have the But when I do set the |
Great, I will check it out! |
@hawkeye217, just a heads up, since the other routes were all singular, I updated the
|
I'm going to close this since everything has been released in |
Thanks for pushing the updates, @jakowenko! I'm still having trouble with the quality of the http snapshot image, though. Are you running that image through anything specific? When I set |
Hm...when you view the raw image with the bounding box in a new tab that should be the original image without any resizing or quality changes. Is there a size difference in that image compared to the one you have in your config for the snapshot? |
Here's an image I just tested with. My config looked like this. cameras:
driveway:
snapshot:
url: https://jakowenko.com/img/david.92f395c6.jpg The image with the bounding box was the same dimensions, the file size was reduced. That's probably because it's loaded into a canvas to draw the box then saved back out. If you remove the ?box=true from the URL you should get the image without the bounding box. Does that one look better? From my test all the dimensions were the exact same, but the image with the bounding box was a smaller file size. Talking off ?box=true matched the orignal source image file size and that's the one used in the detection process. |
Yes, there is a size difference. If I don't have a
Removing the |
Just to clarify a bit more in case it helps - Frigate is also sending an image with a |
Oh I see. The MQTT snapshot image from Frigate is configured from the Frigate config. I'm on my phone so I can paste the link easily, but check my README. It should include an example of how to resize that MQTT image. That should fix your problem then! 🤞 |
Sorry, I might not have been clear... I don't want to do detection from the MQTT image, but from the snapshot url. I mentioned the MQTT image just to possibly further help clarify my problem with the snapshot url image. Am I misunderstanding how the snapshot url works? If it is set, Frigate picks up a person, then Double Take processes the snapshot url instead of frigate's I noticed that setting the If I don't have the |
The processing of the Frigate images / MQTT image is a little confusing and the MQTT one is done separately then the event driven one. Frigate publishes a message to
|
Makes total sense. Your docs are clear, my brain was just not :) I was (falsely) operating under the assumption that the snapshot url replaced the image that frigate was sending on the I'll just have to set up a HA automation to call your Sorry for the confusion, and thanks for your patience! |
It's no problem, thank you for taking the time to checkout this project and provide feedback! I really appreciate it. I'd like to try to build in support for your use case. The method you described above does sound like it could make sense for some users. I'd probably want to nest that under the Frigate config object. It sounds like you still want to process images when I'll have to think about the best way to do that from the config, maybe something like this? You could then override either the frigate:
url: http://frigate:5000
event:
- name: driveway
snapshot: http://url.com/image.jpg
latest: false |
Yes, that's exactly what I am looking to do, and something like that in the config would work great. I love the way the Frigate logic works with mqtt events, and it would be nice to have no additional automations in Home Assistant to be able to use a higher resolution snapshot from the camera for snapshots passed on to the face detectors without burning tons of extra cpu in Frigate for a high res rtsp stream. I'll be happy to test any code you write for my use case if you build it in! Thanks again. |
Something else that could be helpful would be the ability to disable Double Take's processing of Frigate's |
I'll work on a beta build to support your use case and let you know when it's ready. I'll probably open up a new issue to track it. There is a way to disable the Frigate MQTT processing and the latest processing. The latest is global to all Frigate cameras though. Setting frigate:
attempts:
# number of times double take will request a frigate latest.jpg for facial recognition
latest: 0
# number of times double take will request a frigate snapshot.jpg for facial recognition
snapshot: 10
# process frigate images from frigate/+/person/snapshot topics
mqtt: false |
I use Frigate and I have the
detect
role there using a low-res substream of my doorbell camera. It works great for person detection.I currently use some simple automations along with Frigate to grab a higher res snapshot of my doorbell camera when a person is detected in a zone near the doorbell. Then through another automation in Home Assistant, I run Facebox on that image.
I'm considering trying Double Take to get better detection through Facebox and CompreFace, but I'm concerned that the image quality of anything coming from Frigate will be too poor for good detection.
I don't want to switch the
detect
role on Frigate to the higher resolution as it just unnecessarily just burns CPU to detect people. So could I potentially use the http snapshot image option with Double Take to pull the higher res snapshots off of the doorbell camera and process those?If so, what would you suggest as the best way of going about setting that up with HA automations and Double Take?
Thanks!
The text was updated successfully, but these errors were encountered: