Code Monkey home page Code Monkey logo

nwhacks2020-urban-forests's Introduction

Urban Forests

Built for nwHacks 2020, a 24-hour hackathon held at UBC, Vancouver, BC, Canada

Node.js and Express backend, originally hosted on a Microsoft Azure server running Node.js v10

Set-up

Requires a Google Vision API model, edit the link on line 9 of ./routes/index.js to fit your model. As well, include a google API credentials JSON file under the root directory of the folder. It's named urbanforests-key.json in the code, and referred to also in the index.js file linked above.

Effects

  1. After image is uploaded to the HTML site, calls client-side JavaScript to extract the base64 string of the image and sends it to the backend. The backend server saves the string into the file at ./public/request.json and then the client displays a preview of the image on the screen when it's done.
  2. When submit is pressed, client side JS calls endpoint so that backend can execute code
  3. Backend code takes the image string and sends it to Google Vision API through bash commands, takes the terminal output given and sends it back to the client.
  4. Client takes the result payload and does calculations based on it to give the result.

Note: Because of step 1), only one file can be processed at a time. Due to syncronity errors, the most recently uploaded file may not necessarily be the one processed if server has not saved to the ./public/request.json file yet.

nwhacks2020-urban-forests's People

Contributors

bennyw23 avatar edward-le-coding avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.