{ "cells": [ { "cell_type": "markdown", "metadata": { "colab_type": "text", "id": "view-in-github" }, "source": [ "\"Open" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "FK1MZWm7oFa6", "outputId": "ec19e080-086b-4cd6-997f-14dce5c61540" }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Cloning into 'ml-projects'...\n", "remote: Enumerating objects: 3730, done.\u001b[K\n", "remote: Counting objects: 100% (719/719), done.\u001b[K\n", "remote: Compressing objects: 100% (392/392), done.\u001b[K\n", "remote: Total 3730 (delta 305), reused 710 (delta 298), pack-reused 3011\u001b[K\n", "Receiving objects: 100% (3730/3730), 218.98 MiB | 9.61 MiB/s, done.\n", "Resolving deltas: 100% (307/307), done.\n" ] } ], "source": [ "!git clone 'https://github.com/AlvinKimata/ml-projects.git'" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "IUb5rFqssg2j", "outputId": "665d0e33-6d70-4873-d8ad-614dffdcf843" }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "{\"username\":\"kaggle_username\",\"key\":\"kaggle_api_key\"}\n" ] } ], "source": [ "!mkdir ../root/.kaggle/\n", "!echo '{\"username\":\"kaggle_username\",\"key\":\"kaggle_api_key\"}' >> /root/.kaggle/kaggle.json\n", "!chmod 400 ../root/.kaggle/kaggle.json #Read-only\n", "!cat ../root/.kaggle/kaggle.json" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "owPZaNL8qAW8", "outputId": "60e95755-df58-4906-e7ca-c9bb950c95cb" }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Downloading fakeavceleb-tfrecord.zip to /content\n", " 98% 1.52G/1.55G [00:20<00:00, 116MB/s]\n", "100% 1.55G/1.55G [00:21<00:00, 79.2MB/s]\n" ] } ], "source": [ "!kaggle datasets download -d kimatadebonair/fakeavceleb-tfrecord" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "id": "SG3kuPIJstaN" }, "outputs": [], "source": [ "!unzip -q '/content/fakeavceleb-tfrecord.zip' -d inputs/" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "CyAvPAhKgi9K" }, "outputs": [], "source": [ "!pip install -r 'DFDT TMC/requirements.txt'" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "id": "sbBCy3Nps3V-" }, "outputs": [], "source": [ "!cp -r '/content/ml-projects/DFDT TMC' ./" ] }, { "cell_type": "code", "execution_count": 8, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "LYmBafKPuGOM", "outputId": "cebc40c2-40c2-4425-f4e8-55e7656df4d3" }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "cp: cannot stat '/content/inputs/fakeavceleb_1k-000010-of-00015': No such file or directory\n", "cp: cannot stat '/content/inputs/fakeavceleb_1k-000011-of-00015': No such file or directory\n", "cp: cannot stat '/content/inputs/fakeavceleb_1k-000012-of-00015': No such file or directory\n", "cp: cannot stat '/content/inputs/fakeavceleb_1k-000013-of-00015': No such file or directory\n" ] } ], "source": [ "for i in range(14):\n", " !cp '/content/inputs/fakeavceleb_1k-0000{i}-of-00015' '/content/DFDT TMC/datasets/train'" ] }, { "cell_type": "code", "execution_count": 11, "metadata": { "id": "O1mT677Uc0qu" }, "outputs": [], "source": [ "for i in range(10, 15):\n", " !cp '/content/inputs/fakeavceleb_1k-000{i}-of-00015' '/content/DFDT TMC/datasets/train'" ] }, { "cell_type": "code", "execution_count": 32, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "_-TCpjHVqT36", "outputId": "88873108-392c-4830-f4e4-76b3a2cc8b3c" }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "--2023-07-14 09:10:01-- https://github.com/selimsef/dfdc_deepfake_challenge/releases/download/0.0.1/final_999_DeepFakeClassifier_tf_efficientnet_b7_ns_0_23\n", "Resolving github.com (github.com)... 192.30.255.112\n", "Connecting to github.com (github.com)|192.30.255.112|:443... connected.\n", "HTTP request sent, awaiting response... 302 Found\n", "Location: https://objects.githubusercontent.com/github-production-release-asset-2e65be/270020698/6e91bf80-a835-11ea-8950-51c980e899ce?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20230714%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20230714T091002Z&X-Amz-Expires=300&X-Amz-Signature=8623af355287f61ac5b0e7857ae8c21efdbeb265ccc3662b57cee5f04f31f572&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=270020698&response-content-disposition=attachment%3B%20filename%3Dfinal_999_DeepFakeClassifier_tf_efficientnet_b7_ns_0_23&response-content-type=application%2Foctet-stream [following]\n", "--2023-07-14 09:10:02-- https://objects.githubusercontent.com/github-production-release-asset-2e65be/270020698/6e91bf80-a835-11ea-8950-51c980e899ce?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20230714%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20230714T091002Z&X-Amz-Expires=300&X-Amz-Signature=8623af355287f61ac5b0e7857ae8c21efdbeb265ccc3662b57cee5f04f31f572&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=270020698&response-content-disposition=attachment%3B%20filename%3Dfinal_999_DeepFakeClassifier_tf_efficientnet_b7_ns_0_23&response-content-type=application%2Foctet-stream\n", "Resolving objects.githubusercontent.com (objects.githubusercontent.com)... 185.199.111.133, 185.199.109.133, 185.199.110.133, ...\n", "Connecting to objects.githubusercontent.com (objects.githubusercontent.com)|185.199.111.133|:443... connected.\n", "HTTP request sent, awaiting response... 200 OK\n", "Length: 266910615 (255M) [application/octet-stream]\n", "Saving to: ‘final_999_DeepFakeClassifier_tf_efficientnet_b7_ns_0_23’\n", "\n", "final_999_DeepFakeC 100%[===================>] 254.54M 66.8MB/s in 3.8s \n", "\n", "2023-07-14 09:10:06 (66.4 MB/s) - ‘final_999_DeepFakeClassifier_tf_efficientnet_b7_ns_0_23’ saved [266910615/266910615]\n", "\n" ] } ], "source": [ "!cd '/content/DFDT TMC/pretrained' && wget 'https://github.com/selimsef/dfdc_deepfake_challenge/releases/download/0.0.1/final_999_DeepFakeClassifier_tf_efficientnet_b7_ns_0_23'''" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "DvA-myf8s9-9", "outputId": "477f4488-e1fb-44bb-b867-71c325c85dcb" }, "outputs": [], "source": [ "!python '/content/DFDT TMC/train_dfdc_tf.py' --device='cuda' \\\n", " --data_dir=\"/content/DFDT TMC/datasets/train/fakeavceleb_1k*\" \\\n", " --pretrained_image_encoder=True --pretrained_audio_encoder=True" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "kGfym7pEn4aP" }, "outputs": [], "source": [] } ], "metadata": { "accelerator": "GPU", "colab": { "authorship_tag": "ABX9TyNzEVTklkrYn6Mgz+yxoZaI", "gpuType": "T4", "include_colab_link": true, "provenance": [] }, "kernelspec": { "display_name": "Python 3", "name": "python3" }, "language_info": { "name": "python" } }, "nbformat": 4, "nbformat_minor": 0 }