Giter VIP home page Giter VIP logo

defakehop's Introduction

The Cayman theme

.github/workflows/ci.yaml Gem Version

Cayman is a Jekyll theme for GitHub Pages. You can preview the theme to see what it looks like, or even use it today.

Thumbnail of Cayman

Usage

To use the Cayman theme:

  1. Add the following to your site's _config.yml:

    remote_theme: pages-themes/[email protected]
    plugins:
    - jekyll-remote-theme # add this line to the plugins list if you already have one
  2. Optionally, if you'd like to preview your site on your computer, add the following to your site's Gemfile:

    gem "github-pages", group: :jekyll_plugins

Customizing

Configuration variables

Cayman will respect the following variables, if set in your site's _config.yml:

title: [The title of your site]
description: [A short description of your site's purpose]

Additionally, you may choose to set the following optional variables:

show_downloads: ["true" or "false" (unquoted) to indicate whether to provide a download URL]
google_analytics: [Your Google Analytics tracking ID]

Stylesheet

If you'd like to add your own custom styles:

  1. Create a file called /assets/css/style.scss in your site
  2. Add the following content to the top of the file, exactly as shown:
    ---
    ---
    
    @import "{{ site.theme }}";
  3. Add any custom CSS (or Sass, including imports) you'd like immediately after the @import line

Note: If you'd like to change the theme's Sass variables, you must set new values before the @import line in your stylesheet.

Layouts

If you'd like to change the theme's HTML layout:

  1. For some changes such as a custom favicon, you can add custom files in your local _includes folder. The files provided with the theme provide a starting point and are included by the original layout template.
  2. For more extensive changes, copy the original template from the theme's repository
    (Pro-tip: click "raw" to make copying easier)
  3. Create a file called /_layouts/default.html in your site
  4. Paste the default layout content copied in the first step
  5. Customize the layout as you'd like

Customizing Google Analytics code

Google has released several iterations to their Google Analytics code over the years since this theme was first created. If you would like to take advantage of the latest code, paste it into _includes/head-custom-google-analytics.html in your Jekyll site.

Overriding GitHub-generated URLs

Templates often rely on URLs supplied by GitHub such as links to your repository or links to download your project. If you'd like to override one or more default URLs:

  1. Look at the template source to determine the name of the variable. It will be in the form of {{ site.github.zip_url }}.
  2. Specify the URL that you'd like the template to use in your site's _config.yml. For example, if the variable was site.github.url, you'd add the following:
    github:
      zip_url: http://example.com/download.zip
      another_url: another value
  3. When your site is built, Jekyll will use the URL you specified, rather than the default one provided by GitHub.

Note: You must remove the site. prefix, and each variable name (after the github.) should be indent with two space below github:.

For more information, see the Jekyll variables documentation.

Roadmap

See the open issues for a list of proposed features (and known issues).

Project philosophy

The Cayman theme is intended to make it quick and easy for GitHub Pages users to create their first (or 100th) website. The theme should meet the vast majority of users' needs out of the box, erring on the side of simplicity rather than flexibility, and provide users the opportunity to opt-in to additional complexity if they have specific needs or wish to further customize their experience (such as adding custom CSS or modifying the default layout). It should also look great, but that goes without saying.

Contributing

Interested in contributing to Cayman? We'd love your help. Cayman is an open source project, built one contribution at a time by users like you. See the CONTRIBUTING file for instructions on how to contribute.

Previewing the theme locally

If you'd like to preview the theme locally (for example, in the process of proposing a change):

  1. Clone down the theme's repository (git clone https://github.com/pages-themes/cayman)
  2. cd into the theme's directory
  3. Run script/bootstrap to install the necessary dependencies
  4. Run bundle exec jekyll serve to start the preview server
  5. Visit localhost:4000 in your browser to preview the theme

Running tests

The theme contains a minimal test suite, to ensure a site with the theme would build successfully. To run the tests, simply run script/cibuild. You'll need to run script/bootstrap once before the test script will work.

hongshuochen.io

defakehop's People

Contributors

hongshuochen 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

Watchers

 avatar  avatar

defakehop's Issues

About dataset

Hey,thanks for your great work!I have some question about experiment dataset.
Do you train on celeb train set and test on celeb test set?or train on FF++ train set and test on celeb test set?
Best wish!

How to train with image dataset?

Below is my file structure, each folder contains several images.

.
├── train
│   ├── fake
│   └── real
├── val
│   ├── fake
│   └── real

Can I use images to train the model directly?

hang in soft classifiers?

i tried to run your code but i got a hang after this output (on ubuntu and anaconda)
"
(4360, 32, 32, 3)
==============================left_eye==============================
===============DefakeHop Training===============
===============MultiChannelWiseSaab Training===============
Hop1
Input shape: (4360, 32, 32, 3)
Output shape: (4360, 15, 15, 12)
Hop2
SaabID: 0 ChannelID: 0 Energy: 0.3909475878148454
Input shape: (4360, 15, 15, 1)
Output shape: (4360, 7, 7, 7)
SaabID: 0 ChannelID: 1 Energy: 0.3447543175276042
Input shape: (4360, 15, 15, 1)
Output shape: (4360, 7, 7, 8)
SaabID: 0 ChannelID: 2 Energy: 0.10680955446396825
Input shape: (4360, 15, 15, 1)
Output shape: (4360, 7, 7, 8)
SaabID: 0 ChannelID: 3 Energy: 0.05905506598019355
Input shape: (4360, 15, 15, 1)
Output shape: (4360, 7, 7, 5)
SaabID: 0 ChannelID: 4 Energy: 0.03872900013611077
Input shape: (4360, 15, 15, 1)
Output shape: (4360, 7, 7, 5)
SaabID: 0 ChannelID: 5 Energy: 0.023054650053579685
Input shape: (4360, 15, 15, 1)
Output shape: (4360, 7, 7, 8)
Hop3
SaabID: 0 ChannelID: 0 Energy: 0.24112964726659797
Input shape: (4360, 7, 7, 1)
Output shape: (4360, 3, 3, 8)
SaabID: 0 ChannelID: 1 Energy: 0.09732579918720609
Input shape: (4360, 7, 7, 1)
Output shape: (4360, 3, 3, 8)
SaabID: 0 ChannelID: 2 Energy: 0.02775095300424238
Input shape: (4360, 7, 7, 1)
Output shape: (4360, 3, 3, 5)
SaabID: 0 ChannelID: 3 Energy: 0.015179178866751176
Input shape: (4360, 7, 7, 1)
Output shape: (4360, 3, 3, 5)
SaabID: 1 ChannelID: 0 Energy: 0.19901943188942417
Input shape: (4360, 7, 7, 1)
Output shape: (4360, 3, 3, 8)
SaabID: 1 ChannelID: 1 Energy: 0.08213302772662819
Input shape: (4360, 7, 7, 1)
Output shape: (4360, 3, 3, 8)
SaabID: 1 ChannelID: 2 Energy: 0.02246967960746773
Input shape: (4360, 7, 7, 1)
Output shape: (4360, 3, 3, 8)
SaabID: 1 ChannelID: 3 Energy: 0.018863600077674066
Input shape: (4360, 7, 7, 1)
Output shape: (4360, 3, 3, 8)
SaabID: 1 ChannelID: 4 Energy: 0.013172183331202066
Input shape: (4360, 7, 7, 1)
Output shape: (4360, 3, 3, 7)
SaabID: 2 ChannelID: 0 Energy: 0.04175134624454228
Input shape: (4360, 7, 7, 1)
Output shape: (4360, 3, 3, 8)
SaabID: 2 ChannelID: 1 Energy: 0.01873118654102847
Input shape: (4360, 7, 7, 1)
Output shape: (4360, 3, 3, 6)
SaabID: 2 ChannelID: 2 Energy: 0.01694263964772816
Input shape: (4360, 7, 7, 1)
Output shape: (4360, 3, 3, 6)
SaabID: 2 ChannelID: 3 Energy: 0.013554258645960802
Input shape: (4360, 7, 7, 1)
Output shape: (4360, 3, 3, 7)
SaabID: 3 ChannelID: 0 Energy: 0.024407171663723276
Input shape: (4360, 7, 7, 1)
Output shape: (4360, 3, 3, 5)
SaabID: 3 ChannelID: 1 Energy: 0.02307696785774328
Input shape: (4360, 7, 7, 1)
Output shape: (4360, 3, 3, 5)
SaabID: 4 ChannelID: 0 Energy: 0.014326932815538707
Input shape: (4360, 7, 7, 1)
Output shape: (4360, 3, 3, 4)
SaabID: 4 ChannelID: 1 Energy: 0.012846123839138926
Input shape: (4360, 7, 7, 1)
Output shape: (4360, 3, 3, 5)
spent 7.283803701400757 s
===============MultiChannelWiseSaab Transformation===============
Hop1
Input shape: (4360, 32, 32, 3)
Output shape: (4360, 15, 15, 12)
Hop2
SaabID: 0 ChannelID: 0
Input shape: (4360, 15, 15, 1)
Output shape: (4360, 7, 7, 7)
SaabID: 0 ChannelID: 1
Input shape: (4360, 15, 15, 1)
Output shape: (4360, 7, 7, 8)
SaabID: 0 ChannelID: 2
Input shape: (4360, 15, 15, 1)
Output shape: (4360, 7, 7, 8)
SaabID: 0 ChannelID: 3
Input shape: (4360, 15, 15, 1)
Output shape: (4360, 7, 7, 5)
SaabID: 0 ChannelID: 4
Input shape: (4360, 15, 15, 1)
Output shape: (4360, 7, 7, 5)
SaabID: 0 ChannelID: 5
Input shape: (4360, 15, 15, 1)
Output shape: (4360, 7, 7, 8)
Hop3
SaabID: 0 ChannelID: 0
Input shape: (4360, 7, 7, 1)
Output shape: (4360, 3, 3, 8)
SaabID: 0 ChannelID: 1
Input shape: (4360, 7, 7, 1)
Output shape: (4360, 3, 3, 8)
SaabID: 0 ChannelID: 2
Input shape: (4360, 7, 7, 1)
Output shape: (4360, 3, 3, 5)
SaabID: 0 ChannelID: 3
Input shape: (4360, 7, 7, 1)
Output shape: (4360, 3, 3, 5)
SaabID: 1 ChannelID: 0
Input shape: (4360, 7, 7, 1)
Output shape: (4360, 3, 3, 8)
SaabID: 1 ChannelID: 1
Input shape: (4360, 7, 7, 1)
Output shape: (4360, 3, 3, 8)
SaabID: 1 ChannelID: 2
Input shape: (4360, 7, 7, 1)
Output shape: (4360, 3, 3, 8)
SaabID: 1 ChannelID: 3
Input shape: (4360, 7, 7, 1)
Output shape: (4360, 3, 3, 8)
SaabID: 1 ChannelID: 4
Input shape: (4360, 7, 7, 1)
Output shape: (4360, 3, 3, 7)
SaabID: 2 ChannelID: 0
Input shape: (4360, 7, 7, 1)
Output shape: (4360, 3, 3, 8)
SaabID: 2 ChannelID: 1
Input shape: (4360, 7, 7, 1)
Output shape: (4360, 3, 3, 6)
SaabID: 2 ChannelID: 2
Input shape: (4360, 7, 7, 1)
Output shape: (4360, 3, 3, 6)
SaabID: 2 ChannelID: 3
Input shape: (4360, 7, 7, 1)
Output shape: (4360, 3, 3, 7)
SaabID: 3 ChannelID: 0
Input shape: (4360, 7, 7, 1)
Output shape: (4360, 3, 3, 5)
SaabID: 3 ChannelID: 1
Input shape: (4360, 7, 7, 1)
Output shape: (4360, 3, 3, 5)
SaabID: 4 ChannelID: 0
Input shape: (4360, 7, 7, 1)
Output shape: (4360, 3, 3, 4)
SaabID: 4 ChannelID: 1
Input shape: (4360, 7, 7, 1)
Output shape: (4360, 3, 3, 5)
spent 3.1094441413879395 s
===============Features Dimensions===============
Hop1 (4360, 15, 15, 12)
Hop2 (4360, 7, 7, 41)
Hop3 (4360, 3, 3, 111)
===============Spatial Dimension Reduction===============
Input shape: (15, 15) 225
Output shape: 32
Input shape: (7, 7) 49
Output shape: 12
Input shape: (3, 3) 9
Output shape: 5
===============Soft Classifiers===============
"
crtl c
"
^CTraceback (most recent call last):
File "model.py", line 163, in
model.fit_region(region, train_images, train_labels, train_names, multi_cwSaab_parm)
File "model.py", line 34, in fit_region
features = defakehop.fit(images, labels)
File "/home/user21/workspace/DefakeHop/defakeHop.py", line 54, in fit
fit_all_channel_wise_clf(self.features, labels, n_jobs=4)
File "/home/user21/workspace/DefakeHop/defakeHop.py", line 150, in fit_all_channel_wise_clf
pool.starmap(fit_channel_wise_clf, parameters)
File "/home/user21/anaconda3/lib/python3.8/multiprocessing/pool.py", line 372, in starmap
return self._map_async(func, iterable, starmapstar, chunksize).get()
File "/home/user21/anaconda3/lib/python3.8/multiprocessing/pool.py", line 765, in get
self.wait(timeout)
File "/home/user21/anaconda3/lib/python3.8/multiprocessing/pool.py", line 762, in wait
self._event.wait(timeout)
File "/home/user21/anaconda3/lib/python3.8/threading.py", line 558, in wait
signaled = self._cond.wait(timeout)
File "/home/user21/anaconda3/lib/python3.8/threading.py", line 302, in wait
waiter.acquire()
KeyboardInterrupt
"

Unable to train the model

Hey,
It is a nice work and really appreciated.

I am getting an error when i run python model.py. May i ask you what could be the problem?
Thanks!

Screenshot from 2021-12-08 15-44-53

A small issue with column names

There is a small issue in the patch_extractor.py file. The name of columns are little bit different.
Instead of: df['success'] we have to use: df[' success'] (extra single whitespace). In my case, I used Docker way to extract features from video frames in the landmark_extractor.py file. For some reason, all columns name have extra whitespace in the begging except the first column ('frame'). Perhaps, you will not face with the same problem if you would used another method for feature extraction.

About Model Size / Saving Model

I wanted to ask about model size which you got after training Celab and FF++ datasets. I wanted to save the model and then use it for single prediction, but as I understood for prediction we need to save the "classifier" and "defakeHop" objects. However defakeHop object size depends on the training data. In results I have 10GB defakeHop and 760 KB classifier. May I did something wrong? How would you save the model for the future prediction? If you have some time could you explain it to me?

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.