Code Monkey home page Code Monkey logo

checkface's People

Contributors

apcteo avatar cdilga avatar codacy-badger avatar dependabot[bot] avatar olivercoad avatar winahana 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

Watchers

 avatar  avatar  avatar

checkface's Issues

Image olicoad/encoder4editing not available anymore

Hi,

We are trying to run checkface locally and want to run the encoder4editing service locally as well.
Unfortunately the image, as referenced in your docker-compose.yaml is not available anymore on docker hub (olicoad/encoder4editing:latest). There are other images with the same name available but they don't seem to run an HTTP service and exit immediately after starting.

Any advice on how to overcome this problem?

Thanks in advance!

Setup CI/CD to build installers

Using Travis CI free tier for open source, create a GitHub release with build artefacts including the MSI and other Windows installers, and the electron installer if we get it working

Whitespace is not handled correctly

On the clients, the value is not trimmed, allowing for values such as "c " to be requested. However, on the website, it does not include trailing spaces in the url query parameter even though it makes the api request with the trailing spaces.

Current Behaviour

After typing in "c " in checkface.ml, the url is updated to https://checkface.ml/?value=c instead of https://checkface.ml/?value=c%20%20%20%20.

Expected behaviour

Either the worker trims the input so that both requests are the same, or the website should include trailing spaces in the query parameter.

Server side render website meta tags

In order to give better social media cards when linking to particular searches from the website, the meta tags og:image and og:title need to be server side rendered based on the value query parameter.

For example, https://checkface.ml/?value=qwert should have

<meta property="og:image" content="https://api.checkface.ml/api/qwert?dim=1000" />
<meta property="og:title" content="Check Face - qwert" />

At this point it would be good to keep it simple and could be done with a template engine such as php or https://github.com/giraffe-fsharp/Giraffe.DotLiquid

Add documentation for the api

In preparation for people doing projects using the api, it is important to add easily accessible documentation for

  • how to generate a face using seed/hashvalue/latents
  • how to register latents
  • how to make morphing gifs and mp4s

Nccl Library Unavailable on windows

Training StyleGAN on multiple GPUs requires Nccl, which is not included on windows.
There is some custom way of reducing and updating all of the gradients across the devices which is not similar to the api's exposed by tensorflow.

This causes an error like:

tensorflow.python.framework.errors_impl.InvalidArgumentError: No OpKernel was registered to support Op 'NcclAllReduce' used by node TrainD/SumAcrossGPUs/NcclAllReduce (defined at D:\data\oliver-train-checkface\fflowhq\00005-sgan-flower-1gpu\src\dnnlib\tflib\optimizer.py:135) with these attrs: [reduction="sum", shared_name="c124", T=DT_FLOAT, num_devices=2]

There is no drop in replacement that has been found, because the api for tf generic operations like a HierachicalAllReduce which is used in Keras like in: tensorflow/tensorflow#21470
is not compatible with the nccl_ops.py interface https://github.com/tensorflow/tensorflow/blob/r1.14/tensorflow/python/ops/nccl_ops.py

Perhaps even more surprising is the fact that other ops, like: collective_ops.py
https://github.com/tensorflow/tensorflow/blob/r1.14/tensorflow/python/ops/collective_ops.py
do not provide drop in replacements. These ops seem to have completely different use cases as is made clear by their use in tests:
https://github.com/tensorflow/tensorflow/blob/r1.14/tensorflow/python/ops/nccl_ops_test.py
https://github.com/tensorflow/tensorflow/blob/r1.14/tensorflow/python/ops/collective_ops_test.py

The line that needs to be updated or removed seems to be the following:

g = nccl_ops.all_sum(g)

This is the point at which all of the device gradients are summed together before updating each of the devices. However, higher level api's like HierarchicalAllReduce would handle this entire process, including the updating of each of the devices, but is not well suited to this use case.

@olivercoad

Create Recover Latent Endpoint

As per the following pseudocode, implement the endpoint

# @app.route('/api/recoverlatent/cropface/', methods=['GET'])
# def recoverlatent(imgguid):
#     get image
#     return croppedimgguid

Use Serverless infrastructure for returning images and social preview

We wish to change the current way of rendering social previews using php in the docs/index.php to use a lambda to do this for much cheaper. The costs aren't trivial, though they're not big either.

Additionally, an internal reverse proxy to our on-prem server would mean we can still have an autoscaling group on an ALB but not have to pay for the t2.micro instance running nginx currently.

This blog post has details on how to return images, which proved quite difficult: https://aws.amazon.com/tw/blogs/compute/microservices-without-the-servers/?sc_campaign=blog&sc_category=compute&sc_channel=SM&sc_content=serverless&sc_detail=std&sc_medium=aws&sc_publisher=fb_ln&adbsc=social_blogs_20150909_52150936&adbid=882627328441300&adbpl=fb&adbpr=153063591397681

Potential race condition

One time got corrupted video when loading same mp4 from multiple places at the same time.
I'm speculating that the second load loaded the existing mp4 because the file existed even though it was only partly created.

It should probly wait to make sure the video file is actually finished generating before serving it.

image

Question mark handed incorrectly client side

Current Behavior:
When a question mark is included in the hash, the default dimension of 300 is induced

Expected behavior:
Question marks have no impact on size and the ?dim=500 argument persists regardless of textbox entry

Proposal:
Check how the client side box is sending ? chars and see if it's interfering with the GET request url and causing it to be malformed

URL Decoding on server is not correct

In order to handle any user input correctly (see #4), it has to be URL encoded before placing in the URL.
For example, in javascript, encodeURIComponent("asdf ") returns asdf%20%20.
This generates the following face.
Checkface for url encoding as asdf%20%20

Unfortunately, that's not the only way spaces (and probably other things) can be URL encoded.
For example, an HTML form request or System.Web.HttpUtility.UrlEncode will encode spaces as + rather than %20: System.Web.HttpUtility.UrlEncode("asdf ") returns asdf++.
This generates the following face, noticably different to above.
Checkface for url encoding as asdf++

Furthermore, it returns the same face for asdf%2B%2B as asdf++; %2B is the url encoding of +.

I expect the problem is to do with how flask automatically decodes parts of the path to pass as the hash parameter

@app.route('/api/<path:hash>', methods=['GET'])
def image_generation(hash):

Expected Behaviour:
The generated face for the url encodings as asdf%20%20 and asdf++ should both be the same (should both be the first image), corresponding to the user input of asdf .
The generated face for the url encoding as asdf%2B%2B should be different (it should be the second image), and correspond to the user input of asdf++.

Privacy concerns of using checkface

Because people are human, some may think it is a good idea to put their passwords in for some reason.
Unfortunately, since this sends an api request to the server, which keeps logs, we could unintentionally end up with lists of passwords.

A solution could be to pre-hash all values on all clients before sending them to the server, so that no logs of user input is kept while still being able to cache requests.
This would mean that when checking a file, there are three hashing steps:

  • SHA256 (or whatever method the user clicks) of file
  • Send request using hash of that
  • Server received request and takes hash of it to generate seed for the rng

Make landing page more mobile friendly

The layout of the landing page isn't very good for mobile at the moment.

image

Ideally, one should be able to enter values to the text box, click submit, and view the entire face all without scrolling.

Browser history doesn't update preview

When using the back button to go to previous values, the preview image does not go back and the text in the search box does reflect the old value.

Note: this issue does not replicate on the very first search after a reload because that uses a full form request and subsequent searches use javascript and history api.

Decoding value from URL twice?

See #18 for context.

If a user inputs asdf%2B%2B *(not as the first search on that tab), it is, as expected, URL encoded as asdf%252B%252B and generates the following face.
Checkface for url encoding as asdf%252B%252B

However, if you navigate to https://checkface.ml/?value=asdf%252B%252B, it shows the input box and checkface for asdf++ instead, which normally has the url https://checkface.ml/?value=asdf%2B%2B.

*Although this is not caused by a18c70e, it is complicated as it makes the first search one does after navigating to checkface do a full page navigation (whereas subsequent requests are done with the original behaviour using javascript like a SPA).

Extension card text position

The position of text in the popups and hover tips with the extension is inconsistent. They should all be above and centred, but are sometimes to the left of the image.

image

Running an instance of checkface server

Hello! This is a really cool project. Thank you very much for making it open source. You mention in the README,

If you don't have a suitable GPU, you canrun the backend with an AWS p3 instance on ECS, or g3s.xlarge via docker-machine for testing.

I am trying to deploy this to an AWS instance, but am facing some issues. I'm looking at the following tutorial as a guide for deploying this. Would this be the correct strategy? Have you found that your AWS account limits needed to be lifted for running the necessary P3 or g3s.xlarge specs? Also, I'm curious what you've found to be the costs.

Apologies for all the questions, which are more related to devops and cloud than this repo specifically, but thank you very much in advance if you could provide any additional guidance. Thank you!!!

Migrate open GitLab issues

As GitHub is better for visibility, we may as well use it for active development and make use of issues here

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.