Download forensics/exif.py from LPX55/DeepfakeDetection-Explainability: direct link, hf CLI and curl.
- Browser
- Download file 400 Bytes
-
https://huggingface.co/spaces/LPX55/DeepfakeDetection-Explainability/resolve/main/forensics/exif.py
- Command line
-
hf download hf://spaces/LPX55/DeepfakeDetection-Explainability/forensics/exif.py
-
curl -L -o exif.py https://huggingface.co/spaces/LPX55/DeepfakeDetection-Explainability/resolve/main/forensics/exif.py
400 Bytes
| # import tempfile | |
| # import exiftool | |
| # from PIL import Image | |
| # def exif_full_dump(image: Image.Image) -> dict: | |
| # """Extract all EXIF metadata from an image using exiftool.""" | |
| # with tempfile.NamedTemporaryFile(suffix='.jpg', delete=True) as tmp: | |
| # image.save(tmp.name) | |
| # with exiftool.ExifTool() as et: | |
| # metadata = et.get_metadata(tmp.name) | |
| # return metadata |