GithubHelp home page GithubHelp logo

baroquegrammer's Introduction

Baroquegrammer

Baroquegrammer is a silly little application I made to detect faces in one image and spit them out into another. You can find a demo of this online here.

Setup your own!

Dependencies

  • npm. Find details on installing here

Step 1 - Download the codebase.

Fork (or don't I'm not your boss) the repo and git clone to your machine.

Step 2 - Setting up the base app.

In your terminal:

npm install
open index.html

This should give you a working version of the application (hopefully).

Step 3 - Image creation.

Pick you image! I would recommend the image be no wider than 1000px since I don't do any stretching of the image in browser (this would probably affect the image placement). In your preferred image editor (I use pixelmator but this costs money) use the eraser tool to make a "face hole" (gross). Make a note of how many pixels from the top and left the face is and how many pixels wide the face is.

Save the image to assets/images/main.png. If you rename this (including the extension) you'll need to update the index.html.

Step 4 - Input the face coordinates and width.

Take the numbers you wrote down from Step 3 and input them into the constants in assets/js/index.js:

const PARENT_FACE_X = '157px'; // Distance of face hole from left. Gross.
const PARENT_FACE_Y = '76px' // Distance of face hole from top. Gross.
const PARENT_FACE_HEIGHT = '186px' // The height of the face hole. Gross.
const PARENT_FACE_WIDTH = 135; // The width of the face hole. Gross.

Step 5 - Enjoy!

Hopefully everything is working now! If not, open an issue and let's fix it!

Todo

  • Broken in Safari. Not 100% sure why but I've also put a total of 10 seconds into looking into it. This is a bummer because Safari is my main browser. Will try to fix this soon.
  • Pull out Baroquegrammer to make this a more default app called "Faceplant" to make it a little more generic for forking.
  • Refactor out '#image-preview' and go directly from the file input to the displayed image. This is vestigial code from when I wasn't quite sure what I was doing. Not that I do now.
  • Possibly move constants out to a json file so you don't need to edit the JS source at all.
  • Maybe make a package out of this?

baroquegrammer's People

Contributors

willmanduffy avatar kosamari avatar

Watchers

James Cloos avatar omar 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.