{"id":30053790,"url":"https://github.com/launchplatform/cakelens-v5","last_synced_at":"2025-08-07T19:51:23.402Z","repository":{"id":307236975,"uuid":"1024589503","full_name":"LaunchPlatform/cakelens-v5","owner":"LaunchPlatform","description":"Open-source AI-gen video detection model","archived":false,"fork":false,"pushed_at":"2025-07-30T06:49:41.000Z","size":8608,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-07-30T07:25:15.271Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LaunchPlatform.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-23T00:27:51.000Z","updated_at":"2025-07-30T07:21:12.000Z","dependencies_parsed_at":"2025-07-30T07:25:19.685Z","dependency_job_id":"724ed0a3-1471-45f3-9cfe-ba400883dd4c","html_url":"https://github.com/LaunchPlatform/cakelens-v5","commit_stats":null,"previous_names":["launchplatform/cakelens-v5"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/LaunchPlatform/cakelens-v5","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LaunchPlatform%2Fcakelens-v5","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LaunchPlatform%2Fcakelens-v5/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LaunchPlatform%2Fcakelens-v5/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LaunchPlatform%2Fcakelens-v5/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LaunchPlatform","download_url":"https://codeload.github.com/LaunchPlatform/cakelens-v5/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LaunchPlatform%2Fcakelens-v5/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269315907,"owners_count":24396812,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-07T02:00:09.698Z","response_time":73,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-08-07T19:51:17.823Z","updated_at":"2025-08-07T19:51:23.379Z","avatar_url":"https://github.com/LaunchPlatform.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cakelens-v5 [![CircleCI](https://dl.circleci.com/status-badge/img/gh/LaunchPlatform/cakelens-v5/tree/master.svg?style=svg)](https://dl.circleci.com/status-badge/redirect/gh/LaunchPlatform/cakelens-v5/tree/master)\nOpen-source AI-gen video detection model\n\nPlease see the [blog post](https://fangpenlin.com/posts/2025/07/30/open-source-cakelens-v5/) for more details.\nYou can find the model weight at our [Huggingface Hub repository](https://huggingface.co/fangpenlin/cakelens-v5).\n\n## Installation\n\nInstall the package with its dependencies:\n\n```bash\npip install cakelens-v5\n```\n\n## Command Line Interface\n\nThe package provides a command line tool `cakelens` for easy video detection:\n\n### Basic Usage\n\n```bash\n# Using Hugging Face Hub (recommended)\ncakelens video.mp4\n\n# Using local model file\ncakelens video.mp4 --model-path model.pt\n```\n\n### Options\n\n- `--model-path`: Path to the model checkpoint file (optional - will load from Hugging Face Hub if not provided)\n- `--batch-size`: Batch size for inference (default: 1)\n- `--device`: Device to run inference on (`cpu`, `cuda`, `mps`) - auto-detected if not specified\n- `--verbose, -v`: Enable verbose logging\n- `--output`: Output file path for results (JSON format)\n\n### Examples\n\n```bash\n# Basic detection (uses Hugging Face Hub)\ncakelens video.mp4\n\n# Using local model file\ncakelens video.mp4 --model-path model.pt\n\n# With custom batch size and device\ncakelens video.mp4 --batch-size 4 --device cuda\n\n# Save results to JSON file\ncakelens video.mp4 --output results.json\n\n# Verbose output\ncakelens video.mp4 --verbose\n```\n\n### Output\n\nThe tool provides:\n- Real-time prediction percentages for each label\n- Final mean predictions across all frames\n- Option to save results in JSON format\n- Detailed logging (with `--verbose` flag)\n\n## Programmatic Usage\n\nYou can also use the detection functionality programmatically in your Python code:\n\n### Basic Detection\n\n```python\nimport pathlib\nfrom cakelens.detect import Detector\nfrom cakelens.model import Model\n\n# Create model and load from Hugging Face Hub\nmodel = Model()\n# load the model weights from Hugging Face Hub\nmodel.load_from_huggingface_hub()\n# or, if you have a local model file:\n# model.load_state_dict(torch.load(\"model.pt\")[\"model_state_dict\"])\n\n# Create detector\ndetector = Detector(\n    model=model,\n    batch_size=1,\n    device=\"cpu\"  # or \"cuda\", \"mps\", or None for auto-detection\n)\n\n# Run detection\nvideo_path = pathlib.Path(\"video.mp4\")\nverdict = detector.detect(video_path)\n\n# Access results\nprint(f\"Video: {verdict.video_filepath}\")\nprint(f\"Frame count: {verdict.frame_count}\")\nprint(\"Predictions:\")\nfor i, prob in enumerate(verdict.predictions):\n    print(f\"  Label {i}: {prob * 100:.2f}%\")\n```\n\n## Labels\n\nThe model can detect the following labels:\n\n- **AI_GEN**: Is the video AI-generated or not?\n- **ANIME_1D**: Is the video in 2D anime style?\n- **ANIME_2D**: Is the video in 3D anime style?\n- **VIDEO_GAME**: Does the video look like a video game?\n- **KLING**: Is the video generated by Kling?\n- **HIGGSFIELD**: Is the video generated by Higgsfield?\n- **WAN**: Is the video generated by Wan?\n- **MIDJOURNEY**: Is the video generated using images from Midjourney?\n- **HAILUO**: Is the video generated by Hailuo?\n- **RAY**: Is the video generated by Ray?\n- **VEO**: Is the video generated by Veo?\n- **RUNWAY**: Is the video generated by Runway?\n- **SORA**: Is the video generated by Sora?\n- **CHATGPT**: Is the video generated using images from ChatGPT?\n- **PIKA**: Is the video generated by Pika?\n- **HUNYUAN**: Is the video generated by Hunyuan?\n- **VIDU**: Is the video generated by Vidu?\n\n\u003e **Note**: The **AI_GEN** label is the most accurate as it has the most training data. Other labels have limited training data and may be less accurate.\n\n## Accuracy\n\nThe PR curve of the model is shown below:\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/LaunchPlatform/cakelens-v5/raw/master/assets/pr-curve.png?raw=true\" alt=\"PR Curve\" /\u003e\n\u003c/p\u003e\n\nAt threshold 0.5, the model has an precision of 0.77 and a recall of 0.74.\nThe dataset size is 5,093 videos for training and 498 videos for validation.\nPlease note that the model is not perfect and may make mistakes.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flaunchplatform%2Fcakelens-v5","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flaunchplatform%2Fcakelens-v5","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flaunchplatform%2Fcakelens-v5/lists"}