A newer version of the Gradio SDK is available:
5.44.1
title: Deepfake Detection Bypass Utility
emoji: π
colorFrom: red
colorTo: yellow
sdk: gradio
sdk_version: 5.35.0
app_file: app_gradio.py
pinned: true
short_description: DF detection circumvention utility refactored for HF Spaces.
Image Detection Bypass Utility [Gradio Refactor]
Refactored Gradio app for HF Spaces of Image Detection Bypass, self-proclaimed app for the "Circumvention of AI Detection."
Strictly for research purposes -- please refer to the original repository for more in-depth documentation and up-to-date code.
This refactored repository will not be maintained.
Screenshot
Parameters / Controls β args
mapping
When you click Run, the GUI builds a lightweight argument namespace (similar to a SimpleNamespace
) and passes it to the worker. Below are the important mappings used by the GUI (so you know what your process_image
should expect):
args.noise_std
β Gaussian noise STD (fraction of 255)args.clahe_clip
β CLAHE clip limitargs.tile
β CLAHE tile sizeargs.cutoff
β Fourier cutoff (0.01β1.0)args.fstrength
β Fourier strength (0β1)args.phase_perturb
β phase perturbation STD (radians)args.randomness
β Fourier randomness factorargs.perturb
β small pixel perturbationsargs.fft_mode
β one ofauto
,ref
,model
args.fft_alpha
β alpha exponent for 1/f model (used whenfft_mode=='model'
)args.radial_smooth
β radial smoothing bins for spectrum matchingargs.jpeg_cycles
β number of lossy JPEG encode/decode cycles (camera sim)args.jpeg_qmin
,args.jpeg_qmax
β JPEG quality range used by camera simargs.vignette_strength
β vignette intensity (0β1)args.chroma_strength
β chromatic aberration strength (pixels)args.iso_scale
β exposure multiplier (camera sim)args.read_noise
β read noise in DN (camera sim)args.hot_pixel_prob
β probability of hot pixels (camera sim)args.banding_strength
β banding strengthargs.motion_blur_kernel
β motion blur kernel sizeargs.seed
β integer seed orNone
when seed==0 in UIargs.sim_camera
β bool: run camera simulation pathargs.no_no_bayer
β toggles Bayer/demosaic (True = enable RGGB demosaic)args.fft_ref
β path to reference image (string) orNone
args.ref
β path to auto white-balance reference image (string) orNone
Tip: Your
process_image(inpath, outpath, args)
should be tolerant of missing keys (usegetattr(args, 'name', default)
), or accept the sameSimpleNamespace
object the GUI builds.
Gradio / Hugging Face Spaces
This repository includes a lightweight Gradio front-end (app_gradio.py
) that wraps the existing
process_image(inpath, outpath, args)
pipeline. The Gradio app is suitable for local testing and
for deployment to Hugging Face Spaces (Gradio-backed web apps).
Quick local run
- Install dependencies:
pip install -r requirements.txt
- Launch the Gradio app:
python3 app_gradio.py
Open http://localhost:7860 in your browser. The UI saves the uploaded image to a temporary file,
calls the existing process_image
pipeline, and returns the processed image.
Deploying to Hugging Face Spaces
Ensure the following are present at the repository root:
app_gradio.py
(the Gradio entrypoint)requirements.txt
(must includegradio
and any other runtime deps)
Push the repository to a new Space on Hugging Face (create a new Space and connect this repo or push to the Space's Git remote). Spaces will automatically run the Gradio app.
Notes & tips for Spaces:
- Keep default upload/processing sizes modest to avoid long CPU usage in the free tier.
- If your pipeline uses optional packages (OpenCV, piexif, etc.), make sure they are listed in
requirements.txt
so Spaces installs them. - If processing is slow, consider reducing default image size or exposing fewer parameters to the main UI and keeping advanced controls hidden in an "Advanced" section.
Troubleshooting
- If Gradio is not installed,
app_gradio.py
will raise an error; addgradio
torequirements.txt
. - Any import errors from
image_postprocess
will surface when calling the app; run the smoke test (python3 test_smoke_gradio.py
) locally to validate imports and pipeline execution before pushing.
License
MIT β free to use and adapt. Please include attribution if you fork or republish.