diff --git a/.ipynb_checkpoints/Untitled-checkpoint.ipynb b/.ipynb_checkpoints/Untitled-checkpoint.ipynb new file mode 100644 index 0000000000000000000000000000000000000000..363fcab7ed6e9634e198cf5555ceb88932c9a245 --- /dev/null +++ b/.ipynb_checkpoints/Untitled-checkpoint.ipynb @@ -0,0 +1,6 @@ +{ + "cells": [], + "metadata": {}, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/README.md b/README.md new file mode 100644 index 0000000000000000000000000000000000000000..b51f154052cc925d7ad7f4ab81c3eeee0d9353cd --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +# ssl-checkpoints diff --git a/Untitled.ipynb b/Untitled.ipynb new file mode 100644 index 0000000000000000000000000000000000000000..808158da21676c59f7cea0cb9a769a3a8df7a7db --- /dev/null +++ b/Untitled.ipynb @@ -0,0 +1,3174 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 28, + "id": "9e9f1a9c-62e7-42c1-aadc-83fa2a02e3e0", + "metadata": {}, + "outputs": [], + "source": [ + "import os\n", + "import shutil\n", + "path = \"/mnt/data1/archives/hola/rnd-autosupervision/\"\n", + "dir = [\"nabirds\"]" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "id": "165edf87-d8b6-492f-83b9-329ac5b704e4", + "metadata": {}, + "outputs": [], + "source": [ + "sub_dir = os.listdir(path + \"imagenette2\")" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "78ee288e-19e4-4d62-84fe-69953afba2ab", + "metadata": {}, + "outputs": [], + "source": [ + "import subprocess\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "818be5a1-873d-4a41-8757-85696143bfce", + "metadata": {}, + "outputs": [], + "source": [ + "[os.mkdir(dir[i] + sub_dir[j] ) for i in ]" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "id": "e3049cd3-d334-415a-8946-219b97916e43", + "metadata": {}, + "outputs": [], + "source": [ + "from subprocess import call\n", + "\n", + "def cp_dir(source, target):\n", + " call(['cp', '-a', source, target]) # Linux" + ] + }, + { + "cell_type": "code", + "execution_count": 29, + "id": "3ccfa582-910d-4d67-b57d-5f540b96434c", + "metadata": {}, + "outputs": [], + "source": [ + "from distutils.dir_util import copy_tree\n", + "for d in dir:\n", + " d_update = d\n", + " if d == \"nabirds\":\n", + " d_update = \"nabirds-400\"\n", + " for sub in sub_dir:\n", + " if sub!=\"log\":\n", + " source_path = path + d_update + \"/\" + sub + \"/checkpoints\"\n", + " to_directory = d + \"/\" + sub\n", + " copy_tree(source_path, to_directory)\n", + " # print(d + \"/\" + sub)\n", + " # os.makedirs(\"./\" + d + \"/\" + sub)" + ] + }, + { + "cell_type": "code", + "execution_count": 31, + "id": "d6f8f2a8-f944-4870-8e61-b4e88d8a2444", + "metadata": {}, + "outputs": [], + "source": [ + "from huggingface_hub import HfApi\n", + "api = HfApi()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "9a0fa3ca-2c6e-43d8-8f13-3516b2ebfab6", + "metadata": {}, + "outputs": [ + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "42cf78263b094d4d8bb60f5bf8a00232", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "epoch=199-step=7200-v4.ckpt: 0%| | 0.00/184M [00:00