Updates from March, 2017 Toggle Comment Threads | Keyboard Shortcuts

  • yalamber 5:37 am on March 15, 2017 Permalink | Reply  

    Copy from directory’s subdirectory to parent 

    find . -mindepth 2 -type f -print -exec mv {} . \;

     
  • yalamber 7:15 am on March 12, 2017 Permalink | Reply
    Tags:   

    docker exec -it containerid bash

     
  • yalamber 5:43 am on March 3, 2017 Permalink | Reply
    Tags: AWS, Computer Vision, Face Recognition, Face Swap, , Node.js, Rekognition   

    Aws Rekognition and Face Swap 

    CSS rules to cover face with a boundary or faceswap

    var boundingBox = face.faceMatched.Face.BoundingBox;
    var faceDetail = face.faceMatched.FaceDetail;
    var cssRules = {
      top: 100 * boundingBox.Top + "%",
      left: 100 * boundingBox.Left + "%",
      height: 100 * boundingBox.Height + "%",
      width: 100 * boundingBox.Width + "%",
      transform: "rotateZ(" + faceDetail.Pose.Roll + "deg)",
      borderRadius: "12%",
      zIndex: 2,
      background: url(replacer.png) no-repeat;
      "background-size": "cover"
    };
    

    With node.js and imagemagick faceswap code

    async.reduce(faceData, gm().in('-page', '+0+0', mainImage.path), function(img, face, rcallback) {
      const boundingBox = face.faceMatched.Face.BoundingBox;
      const faceDetail = face.faceMatched.FaceDetail;
      const faceWidth = parseInt(boundingBox.Width * mainImage.width, 10) + 10;
      const faceHeight = parseInt(boundingBox.Height * mainImage.height, 10) + 10;
      const xy = `+${boundingBox.Left * mainImage.width}+${boundingBox.Top * mainImage.height}`;
      //create temp replacer image to overlay with
      gm('replacer-image.png')
      .resize(faceWidth.toString(), faceHeight.toString())
      .rotate('rgba(0,0,0,0)', faceDetail.Pose.Roll)
      .write('/tmp/path.png', (err) => {
        rcallback(err, img.in('-page', xy, '/tmp/path.png'));
      });
    }, function(err, result) {
      result.mosaic().write('./result.png', function (err) {
        if(err) console.log(err);
        else console.log('done');
      });
    });
    
     
c
Compose new post
j
Next post/Next comment
k
Previous post/Previous comment
r
Reply
e
Edit
o
Show/Hide comments
t
Go to top
l
Go to login
h
Show/Hide help
shift + esc
Cancel