This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // import * as tf from "@tensorflow/tfjs-node"; | |
| import * as tf from "@tensorflow/tfjs"; | |
| // Model architecture | |
| export function pricePredictionModel() { | |
| // Clean all variable stored in the engine - otherwise variable already registered error will occour | |
| // tf.disposeVariables() | |
| // Apartment size input | |
| const sizeInput = tf.input({shape: [1], name: 'size'}); | |
| const denseSize = tf.layers.dense({units: 2, name: 'denseSize1'}).apply(sizeInput); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export function qualityOfStay() { | |
| // Clean all variable stored in the engine - otherwise variable already registered error will occour | |
| // tf.disposeVariables() | |
| // let inputs = ['size', 'latitude', 'longitude', ] | |
| const sizeInput = tf.input({shape: [1], name: 'size'}); | |
| const denseSize = tf.layers.dense({units: 2, name: 'denseSize'}).apply(sizeInput); | |
| // latitude input | |
| const latitude = tf.input({shape: [1], name: 'latitude'}); | |
| const denseLatitude = tf.layers.dense({units: 2, name: 'denseLatitude'}).apply(latitude); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div class="container"> | |
| <video class="input_video"></video> | |
| <div class="canvas-container"> | |
| <canvas class="output_canvas" width="1280px" height="720px"> | |
| </canvas> | |
| </div> | |
| <div class="loading"> | |
| <div class="spinner"></div> | |
| <div class="message"> | |
| Loading |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // How to run this code | |
| // 1. Connect the Ardurino UNO to the JETSON NANO via USB Cable | |
| // 2. Connect the step motor driver to pins 8-11 on the Ardurino UNO | |
| // 3. Connect the step motor to the motor driver | |
| // 4. Supply power to the motor driver by connecting it to the 5v and ground pins on the ardurino | |
| // 5. Connect the step swith to the pin 2 of the ardurino and the other pin to GND | |
| // 6. Install Ardurino studio on the JETSON NANO | |
| // 7. Create a new file and copy this code to the newly created file | |
| // 8. Deploy this code to the ardurino UNO | |
| // 9. To simulate a closed BIN, close the circuit using the step switch |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This code is based on work from this website - https://www.pyimagesearch.com/2018/03/19/reading-#barcodes-with-python-and-openmv/ - and modified to fit our purpose | |
| # ## How to run this project | |
| # Ensure that you `python3 installed` | |
| # Make sure that all these dependencies are installed on the JETSON NANO which is running linux using the commands provided below. | |
| # 1. `sudo apt-get install libzbar0` - zbar library is used together with openCV to facilitate reading of barcodes | |
| # 2. Install python module `pyzbar` using command `pip install pyzbar` | |
| # 3. Install python module `imutils` that is used to ease the processing of images using command `pip install imutils` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <Stepper.h> | |
| // Stop switch | |
| int stepswitch = 2; | |
| // Motor | |
| const int stepsPerRevolution = 480; // change this to fit the number of steps per revolution | |
| int motorSpeed = 100; | |
| // initialize the stepper library on pins 8 through 11: | |
| int stepCount = 0; // number of steps the motor has taken | |
| int motorPin8 = 8; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <Stepper.h> | |
| // Stop switch | |
| int stepswitch = 2; | |
| // Motor | |
| const int stepsPerRevolution = 480; // change this to fit the number of steps per revolution | |
| int motorSpeed = 100; | |
| // initialize the stepper library on pins 8 through 11: | |
| int stepCount = 0; // number of steps the motor has taken | |
| int motorPin8 = 8; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| int Lswitch = 2; | |
| int led = 13; | |
| int flag = 0; | |
| void setup() | |
| { | |
| Serial.begin(9600); | |
| pinMode(Lswitch, INPUT); | |
| pinMode(led, OUTPUT); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Stepper Motor Control - speed control | |
| This program drives a unipolar or bipolar stepper motor. | |
| The motor is attached to digital pins 8 - 11 of the Arduino. | |
| A potentiometer is connected to analog input 0. | |
| The motor will rotate in a clockwise direction. The higher the potentiometer value, | |
| the faster the motor speed. Because setSpeed() sets the delay between steps, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from serial import Serial | |
| channel = serial.Serial('/dev/cu.usbserial-1420',9600) | |
| def led_on(): | |
| channel.write('1') | |
| def led_off(): | |
| channel.write('0') | |
| led_on() |
NewerOlder