Send picture telegram - NO USB CAMERA

Is it possible to send a local stored picture from my phone to the Telegram APP and then see it in Node-red?.
I know that we can do that with an usb camera but i want to do it another way.

The idea is to work with some tensorflow, now i have some flows but i need to select manually the picture that i want to process. The main idea is to send the picture through Telegram and then node-red to process it.

I have this by far...

[{"id":"28cdadc8.e454e2","type":"tab","label":"TensorFlow","disabled":false,"info":""},{"id":"fd2a033b.71ad2","type":"fileinject","z":"28cdadc8.e454e2","name":"","x":180,"y":120,"wires":[["ff61bbb2.6de208","9b2fdae2.c3fda8"]]},{"id":"9b2fdae2.c3fda8","type":"cocossd","z":"28cdadc8.e454e2","name":"","x":440,"y":120,"wires":[["bd78d3b7.3cf9c","cb45eb12.edfe58"]]},{"id":"bd78d3b7.3cf9c","type":"debug","z":"28cdadc8.e454e2","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":790,"y":120,"wires":[]},{"id":"ff61bbb2.6de208","type":"image","z":"28cdadc8.e454e2","name":"Original image","width":"160","data":"payload","dataType":"msg","thumbnail":false,"active":true,"pass":false,"outputs":0,"x":310,"y":200,"wires":[]},{"id":"cb45eb12.edfe58","type":"image","z":"28cdadc8.e454e2","name":"","width":"160","data":"annotatedInput","dataType":"msg","thumbnail":false,"active":true,"pass":false,"outputs":0,"x":600,"y":200,"wires":[]}]

If i connect a Telegram Node and debug it i can see that the API stores the picture, so maybe i can capture that and send it to the COCOSSD node.

Look:

Thanks in advance.

hi @Marty1982,
You've tried this?

OR

This is a flow that works. Using the weblink in the message from the Telegram node

2 Likes

Cool! @krambriw

do you have the complete code flow?

Thanks a lot!!

Unfortunately not. Where does it create problems for you? It's pretty straight forward, you have almost everything in already except that you have to add node-red-contrib-image-tools via the palette manager if you want a viewer in the flow

Yes i know is very simple.

What URL should i need to add?.

You move the msg.payload.weblink to msg.url, then it should work

Also check that the output from the http request node is set as "a binary buffer"

Sorry I could not share the complete flow, unfortunately stupid reason not worth mentioninig :wink:

image

Great! it works!
Now i will make a message catching so i can get the Telegram ouput.

thanks a lot!!

2 Likes

Hi!,

The flow works perfectly, now i need to output the cocossd result because it has to detect what kind of image im sending ( a car, a dog, a human, etc...). I can do that manually and the cocossd flow detects what is the content of the image.

You should get that info in the msg received from the coco ssd node??? Have you studied what you get in the msg?
When you say output, what is it you would like to achieve? Present text somewhere or how? Ring a bell :wink:

Uh, ok, let's split the questions.
First, i need to use the COCOSSD to analize the picture and get the image result.

Import this flow so you can understand the main goal and how the COCOSSD works.

[{"id":"fad9a160.c0d7e","type":"fileinject","z":"28cdadc8.e454e2","name":"","x":200,"y":580,"wires":[["cbc38d20.b0301","a21e4670.6b0778","6fff50b.444e4b"]]},{"id":"a21e4670.6b0778","type":"cocossd","z":"28cdadc8.e454e2","name":"","x":620,"y":640,"wires":[["f9e01f42.55c81","85f78770.2220c8"]]},{"id":"f9e01f42.55c81","type":"debug","z":"28cdadc8.e454e2","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":970,"y":640,"wires":[]},{"id":"cbc38d20.b0301","type":"image","z":"28cdadc8.e454e2","name":"Original image","width":"160","data":"payload","dataType":"msg","thumbnail":false,"active":true,"pass":false,"outputs":0,"x":490,"y":720,"wires":[]},{"id":"85f78770.2220c8","type":"image","z":"28cdadc8.e454e2","name":"","width":"160","data":"annotatedInput","dataType":"msg","thumbnail":false,"active":true,"pass":false,"outputs":0,"x":780,"y":720,"wires":[]},{"id":"6fff50b.444e4b","type":"debug","z":"28cdadc8.e454e2","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":470,"y":540,"wires":[]}]

Second, i've worked the same flow modified with a telegram flow so i can send the picture and obtain a message with the result.
Somehow that doesn't work, in the picture you can see that is got stuck in the COCOSSD.

Thanks a lot!

Yes, works fine here! Did you check the documentation for the node?

Uhm is weird because the documentation doesn't say too much. I think the COCOSSD cannot process the image or something is failing during the process that i cannot see it.

I will keep looking...

I dont get how does it work for you....

Are you setting the Viewer Node like this?.

No, see below. You did not read the help instruction for the node??


image

Yes i did...but it still doesn't work.

Maybe i have something misunderstood or not configured propperly.

Yes, strange, is the analyze never finishing? How does the complete msg look like that you send to the coco ssd?

The analyze message never ends...maybe it waits for somethig more or so.

And another strange thing is that i cannot get the complete debug msg. So maybe the COCOSSD not even process anything and the issue is a little before than that node.

I would change the coco node. Try this one instead, much better and I think it is faster

node-red-contrib-tfjs-coco-ssd

image

Ok, what does the function node do?