Git Product home page Git Product logo

selfieaday's Introduction

SelfieADay

My "selfie a day" hobby files.

This is a fork of a fork of a fork.

What is Selfie A Day ?

It's a hobby where a person takes a selfie (photo of him/her) everyday. After a period (years), the pictures are joined to make a timelapse video. The pictures are joined in such a way that the face is centered.

Example video : Hugo Cornellier's AGE 12 to MARRIED

There's also a Reddit community for this hobbyists.

Why ?

For fun ! Also, it's a lazy way to make a journal.

A picture tells a thousand words eh ? You can figure out the place you where, people you were with and how things were.

This repo contains scripts, instructions to manage your own selfie a day project.

Managing Pictures

  • Make a dedicated folder in your phone to store the pics. Make sure the date is correct and pictures have the correct EXIF date. It would be great if the filename contains the date captured. If the folder name is something like 0PSAD, it will show up first because of the number at beginning.
  • Periodically copy this folder from phone to your computer.
  • Back it up to a cloud. What I do is take the pictures in the order of their date, split it into 100, zip it and upload. Usage :
mkdir compressed
python3 split-into-chunks.py 0PSAD compressed

Making Video

Requirements

Run

  • Clone/download this repo
  • Download shape_predictor_68_face_landmarks.dat and place it in the cloned repo folder
  • Install dependencies :
    pip3 install wheel
    pip3 install dlib
    pip3 install scipy
    pip3 install exifread python-resize-image
    
  • Copy pictures to input folder
  • Run make-input.py. This'll resize every images in input folder to a square which solves this
  • Edit pada.conf according to your need
  • Run : python3 pada.py align

Video

Use ffmpeg for making the video from images in output folder. Change fps according to your need using -r flag :

cat aligned/*.jpg | ffmpeg -f image2pipe -r 20 -vcodec mjpeg -i - -vcodec libx264 out.mp4

Sound

I'm gonna add this sound to the video. Sound file name is sound.mp3 :

cat aligned/*.jpg | ffmpeg -f image2pipe -r 10 -vcodec mjpeg -i - -i sound.mp3 -shortest out.mp4

Reduce Video Size

Source :

ffmpeg -i input.mkv -vf "scale=iw/2:ih/2" half_the_frame_size.mkv
ffmpeg -i input.mkv -vf "scale=iw/3:ih/3" a_third_the_frame_size.mkv
ffmpeg -i input.mkv -vf "scale=iw/4:ih/4" a_fourth_the_frame_size.mkv

TODO

  • Align to the right face in pictures with multiple faces
  • Make it faster
  • Make the PADA script work for all image resolutions (eliminate make-input.py)

LICENSES

selfieaday's People

Contributors

subins2000 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

selfieaday's Issues

some error related to file format maybe

raise OSError(f"cannot write mode {im.mode} as JPEG") from e

OSError: cannot write mode RGBA as JPEG

Yeah i am n00b so help me out

Traceback (most recent call last):
  File "C:\Users\ajcoo\AppData\Local\Programs\Python\Python39\lib\site-packages\PIL\JpegImagePlugin.py", line 610, in _save
    rawmode = RAWMODE[im.mode]
KeyError: 'RGBA'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Users\ajcoo\Desktop\bhai time waste\make-input.py", line 42, in <module>
    cover.save(new_name, im.format, quality=100, exif=exif)
  File "C:\Users\ajcoo\AppData\Local\Programs\Python\Python39\lib\site-packages\PIL\Image.py", line 2164, in save
    save_handler(self, fp, filename)
  File "C:\Users\ajcoo\AppData\Local\Programs\Python\Python39\lib\site-packages\PIL\JpegImagePlugin.py", line 612, in _save
    raise OSError(f"cannot write mode {im.mode} as JPEG") from e
OSError: cannot write mode RGBA as JPEG

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.