{"action":"created","issue":{"url":"https://api.github.com/repos/ModelDepot/tfjs-yolo-tiny-demo/issues/5","repository_url":"https://api.github.com/repos/ModelDepot/tfjs-yolo-tiny-demo","labels_url":"https://api.github.com/repos/ModelDepot/tfjs-yolo-tiny-demo/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/ModelDepot/tfjs-yolo-tiny-demo/issues/5/comments","events_url":"https://api.github.com/repos/ModelDepot/tfjs-yolo-tiny-demo/issues/5/events","html_url":"https://github.com/ModelDepot/tfjs-yolo-tiny-demo/issues/5","id":326196994,"number":5,"title":"Advice needed when using single image","user":{"login":"okramovic","id":23452615,"avatar_url":"https://avatars1.githubusercontent.com/u/23452615?v=4","gravatar_id":"","url":"https://api.github.com/users/okramovic","html_url":"https://github.com/okramovic","followers_url":"https://api.github.com/users/okramovic/followers","following_url":"https://api.github.com/users/okramovic/following{/other_user}","gists_url":"https://api.github.com/users/okramovic/gists{/gist_id}","starred_url":"https://api.github.com/users/okramovic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/okramovic/subscriptions","organizations_url":"https://api.github.com/users/okramovic/orgs","repos_url":"https://api.github.com/users/okramovic/repos","events_url":"https://api.github.com/users/okramovic/events{/privacy}","received_events_url":"https://api.github.com/users/okramovic/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-05-24T16:23:29Z","updated_at":"2018-05-24T22:08:52Z","closed_at":null,"author_association":"NONE","body":"Hi,\r\n\r\nI'm trying to rewrite your code so I could upload an image file using file input element instead of webcam. I tried adapting your webcam class functions so I process the image before I pass it to 'run' function, but I get following error:\r\n\r\n> Uncaught (in promise) Error: Error when checking : expected input_1 to have shape [null,416,416,3] but got array with shape [1,460,460,3].\r\n>     at new ValueError (tfjs-yolo-tiny-demo.js:16807)\r\n>     at checkInputData (tfjs-yolo-tiny-demo.js:21558)\r\n>     at Model.predict (tfjs-yolo-tiny-demo.js:21849)\r\n>     at tfjs-yolo-tiny-demo.js:27878\r\n>     at Object.Tracking.tidy (tfjs-yolo-tiny-demo.js:8336)\r\n>     at tfjs-yolo-tiny-demo.js:27878\r\n>     at b (tfjs-yolo-tiny-demo.js:27878)\r\n>     at Generator._invoke (tfjs-yolo-tiny-demo.js:27878)\r\n>     at Generator.t.(:1234/anonymous function) [as next] (http://localhost:1234/dist/tfjs-yolo-tiny-demo.js:27878:23324)\r\n>     at n (tfjs-yolo-tiny-demo.js:27878)\r\n> \r\n\r\nAny idea what I'm missing out? Seems like it could be just something small (I know nothing about the field till now so I'm sorry if it's something super obvious...)"},"comment":{"url":"https://api.github.com/repos/ModelDepot/tfjs-yolo-tiny-demo/issues/comments/391881495","html_url":"https://github.com/ModelDepot/tfjs-yolo-tiny-demo/issues/5#issuecomment-391881495","issue_url":"https://api.github.com/repos/ModelDepot/tfjs-yolo-tiny-demo/issues/5","id":391881495,"user":{"login":"MikeShi42","id":2781687,"avatar_url":"https://avatars2.githubusercontent.com/u/2781687?v=4","gravatar_id":"","url":"https://api.github.com/users/MikeShi42","html_url":"https://github.com/MikeShi42","followers_url":"https://api.github.com/users/MikeShi42/followers","following_url":"https://api.github.com/users/MikeShi42/following{/other_user}","gists_url":"https://api.github.com/users/MikeShi42/gists{/gist_id}","starred_url":"https://api.github.com/users/MikeShi42/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MikeShi42/subscriptions","organizations_url":"https://api.github.com/users/MikeShi42/orgs","repos_url":"https://api.github.com/users/MikeShi42/repos","events_url":"https://api.github.com/users/MikeShi42/events{/privacy}","received_events_url":"https://api.github.com/users/MikeShi42/received_events","type":"User","site_admin":false},"created_at":"2018-05-24T22:08:52Z","updated_at":"2018-05-24T22:08:52Z","author_association":"CONTRIBUTOR","body":"Hello! No worries, so it seems like the image has the wrong size, the model itself usually isn't flexible to the input size of the image, so you have to do a bit of pre-processing to resize the image to the correct shape/dimensions. The error says the model expects \"shape\" [null, 416, 416, 3], which just means an RGB (3 channel) color image of 416x416px (the null being the batch size which is set to any, you don't have to worry about that). Your image is currently 460x460px, so you can just resize it to 416x416 and it should work."}}
{"actor":{"display_login":"MikeShi42"}}