A newer version of the Gradio SDK is available:
5.49.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,modelargs.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 orNonewhen 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) orNoneargs.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 sameSimpleNamespaceobject 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 includegradioand 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.txtso 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.pywill raise an error; addgradiotorequirements.txt. - Any import errors from
image_postprocesswill 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.
