GithubHelp home page GithubHelp logo

nutlope / restorephotos Goto Github PK

View Code? Open in Web Editor NEW
3.7K 25.0 546.0 7.63 MB

Restoring old and blurry face photos with AI.

Home Page: https://www.restorephotos.io/

License: MIT License

TypeScript 94.90% JavaScript 2.26% CSS 2.84%

restorephotos's Introduction

This project restores old face photos using AI. Watch the 4 minute explainer video to see how I built this or see the 15 second demo.

Face Photo Restorer

How it works

It uses an ML model from the Applied Research Center called GFPGAN on Replicate to restore face photos. This application gives you the ability to upload any photo, which will send it through this ML Model using a Next.js API route, and return your restored photo.

Running Locally

Note: I just added auth so these steps are not complete as of now. You can git clone from this specific commit.

Cloning the repository the local machine.

git clone

Creating a account on Replicate to get an API key.

  1. Go to Replicate to make an account.
  2. Click on your profile picture in the top right corner, and click on "Dashboard".
  3. Click on "Account" in the navbar. And, here you can find your API token, copy it.

Storing API key in .env file.

Create a file in root directory of project with env. And store your API key in it, as shown in the .example.env file.

If you'd also like to do rate limiting, create an account on UpStash, create a Redis database, and populate the two environment variables in .env as well. If you don't want to do rate limiting, you don't need to make any changes.

Installing the dependencies.

npm install

Running the application.

Then, run the application in the command line and it will be available at http://localhost:3000.

npm run dev

One-Click Deploy

Deploy the example using Vercel:

Deploy with Vercel

Powered by

This example is powered by the following services:

restorephotos's People

Contributors

issaminu avatar ljwagerfield avatar nick-h4ck3r avatar nutlope avatar smeijer avatar zeke avatar

Stargazers

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

Watchers

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

restorephotos's Issues

auth

how to disable auth?

Blurred faces

Faces in the images have a black blur over them instead of clearing old images up. Tried different image types and sizes in kB. This happens to all images I tried, approx 6 different images all have the same issue. See attached example below.

image

Issue with .jfif file formats

Images in .jfif format

  • Upload occurs normally, it is sent and the loading icon shows.
  • After processing the image return is crashed

image

In the image url i get /_next/image?url=Failed%20to%20restore%20image&w=1080&q=75

When I sent the same image converted to png it worked fine.

Change Port

Hi there,

Is it possible to change the port to something else? Preferably opening it up to allow users to easily modify the port to their choosing.

Kind regards,

Rishi

NSFW false positive

Hello,
I have a false positive with an old family photo (a 3 year old children and a baby)
They are absolutely not naked!
Can we do something about it?
Thanks

asyncFunctionResume

I ran the tool locally and came up with the following error message when uploading an jpeg:

Unhandled Runtime Error
Error: Some error occured, please try again later!
Call Stack
asyncFunctionResume

[native code]


Could not figure what the problem is so far. Anyone got a clue?

Plus de générations

Bonjour,
restorephotos.io est vraiment top.
Allez-vous créer un logiciel avec cette fonction ? Est-il possible d'avoir plus de 5 générations par jour ?
En vous remerciant d'avance,
Cordialement,

Hard-coded download file path

On my phone it keeps asking me to replace the current downloaded file, because this file name here is hard-coded:

<button
onClick={() => {
downloadPhoto(restoredImage!, "restoredPhoto.jpg");
}}

I suggest getting the file name from originalPhoto and using that here instead.

it keeps polling locally

Hi @Nutlope
I am trying to run it locally but it keeps polling (logs: "polling for result...") for quite a long, I used the same image you put on the home page. Do you have any idea/hint on how to resolve it?
thanks

Docker image

Hey there, this is a pretty cool resource. Any chance it could be packaged into a Docker image so it could be deployed in that manner?

Bulk photos restore

Is there a way I can use this tool to restore photos in bulk? Either online or locally?

An issue when uploading another photo, just after processing another photo

First of all i'd like to say, damm this is great, i encountered an error on my second upload just after processing the first photo, My photo could get uploaded ,but never displayed the second photo , to fix this i had to re-route to main page and back to the upload button again... please fix this... great stuff guys

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.