Photo by Waldemar Brandt on Unsplash
import cv2cap = cv2.VideoCapture(0)
fourcc = cv2.VideoWriter_fourcc(*'XVID')
w = int(cap.get(cv2.CAP_PROP_FRAME_WIDTH))
h = int(cap.get(cv2.CAP_PROP_FRAME_HEIGHT))
out = cv2.VideoWriter('output.mp4', fourcc, 20.0, (w,h))

while(cap.isOpened()):
ret, frame = cap.read()
if ret:
out.write(cv2.cvtColor(frame, cv2.COLOR_BGR2RGB))
if cv2.waitKey(1) & 0xFF == ord('q'):
break
else:
break
cap.release()
out.release()
cv2.destroyAllWindows()

Photo by Lili Popper on Unsplash

Step 1 of 2: Add an <input> element to index.html

// index.html...
<input type="file" id="file-input">
...

Step 2 of 2: Add a change handler for the <input> element in index.js

// index.js...
document.getElementById('file-input').addEventListener('change', function() {
console.log(this.files[0].path);
});
...

Photo by Ferenc Almasi on Unsplash


Photo by Hybrid on Unsplash

Step 1 of 5: Create A New React Project Using Create-React-App

npx create-react-app my-sentiment-app
cd my-sentiment-app

Step 2 of 5: Import ml5.js


Photo by Ferenc Almasi on Unsplash

STEP 1 OF 5: Create your app


Photo by Bagus Hernawan on Unsplash
npx create-react-app my-awesome-app
cd my-awesome-app
npm i --save-dev gh-pages

Image by Free-Photos from Pixabay
  • f: to fit the model to the screen. If you find your view far away from your model, f (fit to screen) is your friend.
  • Ctrl+7: Isometric view
  • Ctrl+8: Normal to surface
  • Mouse Wheel Click+Drag (or middle mouse click+drag): Rotate
  • Mouse Wheel Scroll Up: Zoom out. The location of the cursor determines the focal point of the zoom
  • Mouse Wheel Scroll Down: Zoom in
  • Ctrl+Mouse Wheel Click: Pan
  • Right Mouse Click+Drag (on component in assembly): Rotate component, obeying existing constraints

npm i --save-dev eslint eslint-plugin-react
eslint --init
{  "extends": [    "eslint:recommended",    "plugin:react/recommended"  ],  "rules": {    "react/react-in-jsx-scope": "off"  },
"globals": {
"React": "writable" }}


<html>  <head>
</head>
<body> <button id="my-button">Click to Add</button>

<div id="content-container">
<!-- Content will appear here -->
</div>
</body></html>
var addedElements = [];
var elementNum = 0;
$('#my-button').on('click', function()…


<body>
<div id="my-div">
</div>
</body>
$('#my-div').append('<button id="my-button">My Button</button>');
$('#my-div').on('click', '#my-button', function () {

alert('Hello World!');
});

Joel Masters

Creator of Goalsmash.net. Help others achieve their goals. Get paid.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store