# Drag and drop images to canvas p5.js in classification program

**URL:** <https://discourse.processing.org/t/drag-and-drop-images-to-canvas-p5-js-in-classification-program/41795>\
**Category:** Libraries\
**Created:** [April 22, 2023, 6:26pm UTC](https://discourse.processing.org/t/drag-and-drop-images-to-canvas-p5-js-in-classification-program/41795 "2023-04-22T18:26:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lillbre](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/lillbre/32/18325_2.png) [@Lillbre](https://discourse.processing.org/u/Lillbre)\
**Post date:** [April 22, 2023, 6:26pm UTC](https://discourse.processing.org/t/drag-and-drop-images-to-canvas-p5-js-in-classification-program/41795/1 "2023-04-22T18:26:19Z")

</div>

I made a [program] ([p5.js Web Editor](https://editor.p5js.org/LillianBrevik/sketches/LPtwXoF3q)) where I used Image classification using MobileNet and p5.js in p5,js editor. Sometimes I have to drop my images twice for them to show up on the canvas. The classification works directly even if the images do not show…  
Can someone see what error I have made?

---

<div class="post-metadata">

**Author:** ![Lillbre](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/lillbre/32/18325_2.png) [@Lillbre](https://discourse.processing.org/u/Lillbre)\
**Post date:** [May 2, 2023, 4:30pm UTC](https://discourse.processing.org/t/drag-and-drop-images-to-canvas-p5-js-in-classification-program/41795/2 "2023-05-02T16:30:49Z")

</div>

**I solved it!** 😄 I moved the drawing of the image to the gotResults function. The working sketch: [p5.js Web Editor](https://editor.p5js.org/LillianBrevik/sketches/quZf1pKib)
