Skip to content
This repository has been archived by the owner on Aug 1, 2022. It is now read-only.

Can I get access to the canvas element? #107

Closed
umkatakam opened this issue Dec 26, 2020 · 0 comments
Closed

Can I get access to the canvas element? #107

umkatakam opened this issue Dec 26, 2020 · 0 comments
Labels
question Further information is requested

Comments

@umkatakam
Copy link

I am trying to use tensorflow js to classify the drawing done on a canvas that is rendered using react-canvas-draw. However, when I try to access the canvas.ref.current it is not an HTMLCanvasElement. E.g code

import * as mobilenet from "@tensorflow-models/mobilenet";
....
const model = await mobilenet.load();
....
<CanvasDraw ref={canvasRef} .../>
<Button onClick={()=>model.classify(canvasRef.current)> Classify </Button>
....

This code fails inside the click handler during classification.

This is the tensorflow model I am using.

Thanks for the help.

@embiem embiem added the question Further information is requested label Nov 7, 2021
@embiem embiem mentioned this issue Nov 7, 2021
2 tasks
@embiem embiem closed this as completed Nov 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants