{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "### Online Colab Demo: https://colab.research.google.com/drive/14Dqg7oeBkFEtchaHLNpig2BcdkZEogba\n", "### Hugging Face Spaces Demo: https://huggingface.co/spaces/ZhengPeng7/BiRefNet_demo" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 391, "referenced_widgets": [ "7d19deaab4c845eea4705567bdc65d60", "a8941bdff0984189be91fab5bfe1c52c", "b6be81c6cc1e4608a88c785c448bfaa4", "3b0ddb32ffa442aab3b02a22432bb233", "688a14cd34704e4ea2e261f6619449ee", "8a54f72e65a24d7a93852aca8ecae0a2", "7745af46aa694f5b8ff0ec8fbd72025f", "4e5fe4296291455f88ae0e5f257c398e", "60d3c15d4b944546992d3517bb73912a", "a124da94c5b143a29d9420eba3954859", "96485cf384484a709e4c32b74e0223af", "7bef3ce58df040c986a74eb5334f42c9", "1848689bf6a14235b508647d1bdb7f69", "055ec5d0d4da4d1b8df33ddb22d6b55b", "3c9b1a3ed2f64ed58a29083280098292", "b2b95dd8b75d4625ad1bd02a461f304d", "044920317fb64cd088d49f334930b886", "a8416e76428b46c092c7afbf7129b5f9", "ebf0b02bc7734ebea9a846233a1a6ec4", "fb3e80729a214bc5993b62ee04d7c58d", "cf459ec049624ba29f54cceeb1469785", "db64a13268ab452db1241d06f16d3d6a", "80a53775d54e47b2922031cc4cd00548", "e13013a9d20843bca6da8fe9f0fdb644", "6f45e75849f749a1b5fad6e8f7879c8f", "0ef4b41f8d0141859b7767d112596198", "fecc8e75d8d643759123eaf2ff30fa2a", "56eb4e5291404f3289196d526fef524f", "7fb491d5b8f34a2e842518c1e4ea4906", "e02fc794fb3645bda6b802277a3e5c1a", "f9a719112f53400782f97d0683862a5f", "4480d4d37c2648e7bb5635109b5d4715", "67ce0f56b38941749bdb580a830598c2", "6667788f1fa44603a4a04ba8aa5e1cc9", "4d162f2efc364cf793709f0b9c9dc888", "e078f8d23e8449e7a9b5771e342febeb", "a330873af8cf45eca95780c50260dbb9", "61746c0aaf96444391d1a86ea7223cb0", "2ad78a6887eb4a369bac75e2436758b9", "78d3ab060eb64941bcba51fa3b32f493", "1f1a0c0dc2b74d56b68a779ef944416d", "1546b1d7383c4a25b2ab3782ff204cad", "6588cde28032444980c4e314d6b9a648", "3e8d434d8e524c8c9f3fe3359df4b327" ] }, "id": "7lFgKfPS8Icy", "outputId": "2f00b063-86bf-4ba8-fa5e-38d2f5a66462" }, "outputs": [], "source": [ "# Imports\n", "from PIL import Image\n", "import torch\n", "from torchvision import transforms\n", "from IPython.display import display\n", "\n", "import sys\n", "sys.path.insert(0, \"../\")\n", "from models.birefnet import BiRefNet\n", "\n", "\n", "# Load Model\n", "# Option 2 and Option 3 is better for local running -- we can modify codes locally.\n", "\n", "# # # Option 1: loading BiRefNet with weights:\n", "# from transformers import AutoModelForImageSegmentation\n", "# birefnet = AutoModelForImageSegmentation.from_pretrained('zhengpeng7/BiRefNet', trust_remote_code=True)\n", "\n", "# Option-2: loading weights with BiReNet codes:\n", "model = [\n", " 'zhengpeng7/BiRefNet',\n", " 'zhengpeng7/BiRefNet-portrait',\n", " 'zhengpeng7/BiRefNet-legacy', 'zhengpeng7/BiRefNet-DIS5K-TR_TEs', 'zhengpeng7/BiRefNet-DIS5K', 'zhengpeng7/BiRefNet-HRSOD', 'zhengpeng7/BiRefNet-COD',\n", " 'zhengpeng7/BiRefNet_lite', # Modify the `bb` in `config.py` to `swin_v1_tiny`.\n", " ][0]\n", "birefnet = BiRefNet.from_pretrained(\n", " model\n", ")\n", "model_name = model.split('/')[-1]\n", "\n", "# # Option-3: Loading model and weights from local disk:\n", "# from utils import check_state_dict\n", "\n", "# birefnet = BiRefNet(bb_pretrained=False)\n", "# state_dict = torch.load('../BiRefNet-general-epoch_244.pth', map_location='cpu', weights_only=True)\n", "# state_dict = check_state_dict(state_dict)\n", "# birefnet.load_state_dict(state_dict)\n", "\n", "device = 'cuda' if torch.cuda.is_available() else 'cpu'\n", "\n", "torch.set_float32_matmul_precision(['high', 'highest'][0])\n", "\n", "birefnet.to(device)\n", "birefnet.eval()\n", "print('BiRefNet is ready to use.')\n", "\n", "# Input Data\n", "transform_image = transforms.Compose([\n", " transforms.Resize((1024, 1024)),\n", " transforms.ToTensor(),\n", " transforms.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225])\n", "])" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Do the inferences on all videos in directory **videos_todo**" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import os\n", "from glob import glob\n", "\n", "video_src_paths = sorted([f for f in glob('../videos_todo/*') if os.path.splitext(f)[1] in ('.mp4', '.avi')], key=lambda x: int(x.split('/')[-1].split('.')[0]))\n", "print('video_src_paths:', video_src_paths)" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 1000 }, "id": "PECYekO53hrR", "outputId": "73f47406-9d92-48b1-fe74-abbb5b83c7a8" }, "outputs": [], "source": [ "import cv2\n", "import numpy as np\n", "from image_proc import refine_foreground\n", "from time import time\n", "\n", "autocast_ctx = torch.amp.autocast(device_type='cuda', dtype=[torch.float16, torch.bfloat16][0])\n", "for video_src_path in video_src_paths[:]:\n", " print('\\nvideo_src_path:', video_src_path)\n", " src_dir = os.path.join('../frames-{}-video_{}'.format(model_name, os.path.splitext(os.path.basename(video_src_path))[0]))\n", " video_ext = os.path.splitext(video_src_path)[-1]\n", " video_dst_path_mask = video_src_path.replace(video_ext, '-preds_mask-{}'.format(model_name)+video_ext)\n", " video_dst_path_subject = video_src_path.replace(video_ext, '-preds_subject-{}'.format(model_name)+video_ext)\n", " vidcap = cv2.VideoCapture(video_src_path)\n", " fps = vidcap.get(cv2.CAP_PROP_FPS)\n", " success, image = vidcap.read()\n", "\n", " video_writer_shape = image.shape[:2][::-1]\n", " video_writer_mask = cv2.VideoWriter(video_dst_path_mask, cv2.VideoWriter_fourcc(*'mp4v'), fps, video_writer_shape, isColor=False)\n", " video_writer_subject = cv2.VideoWriter(video_dst_path_subject, cv2.VideoWriter_fourcc(*'mp4v'), fps, video_writer_shape, isColor=True)\n", "\n", " count = 0\n", " while success:\n", " os.makedirs(src_dir, exist_ok=True)\n", " cv2.imwrite(os.path.join(src_dir, 'frame_{}.png'.format(count)), image)\n", " success, image = vidcap.read()\n", " count += 1\n", "\n", " image_paths = sorted(glob(os.path.join(src_dir, '*')), key=lambda x: int(os.path.splitext(os.path.basename(x).split('_')[-1])[0])) # Sorted by the frame index.\n", " # dst_dir = '../predictions'\n", " # os.makedirs(dst_dir, exist_ok=True)\n", " time_st = time()\n", " batch_size = 1\n", " for idx in range(0, len(image_paths[:]), batch_size):\n", " image_path = image_paths[idx]\n", " if (idx // batch_size + 1) % int(len(image_paths) // batch_size * 0.1) == 0:\n", " print('Processing {} / {} ...'.format(image_path, len(image_paths)))\n", " input_images_pil = [image.convert(\"RGB\") if image.mode != \"RGB\" else image\n", " for image in [Image.open(image_path) for image_path in image_paths[idx:idx + batch_size]]]\n", " input_images = [transform_image(input_image).unsqueeze(0).to(device) for input_image in input_images_pil]\n", " input_images = torch.cat(input_images, dim=0)\n", "\n", " # Prediction\n", " with autocast_ctx, torch.no_grad():\n", " preds = birefnet(input_images)[-1].sigmoid().to(torch.float32).cpu()\n", "\n", " for idx_pred in range(preds.shape[0]):\n", " pred = preds[idx_pred].squeeze()\n", " image = input_images_pil[idx_pred]\n", "\n", " # Show Results\n", " pred_pil = transforms.ToPILImage()(pred)\n", " # pred_pil.resize(image.size).save(image_path.replace(src_dir, dst_dir))\n", "\n", " image_masked = refine_foreground(image, pred_pil)\n", " image_masked.putalpha(pred_pil.resize(image.size))\n", "\n", " video_writer_mask.write(np.array(pred_pil.convert('L').resize(image.size)))\n", " array_foreground = np.array(image_masked)[:, :, :3].astype(np.float32)\n", " array_mask = (np.array(image_masked)[:, :, 3:] / 255).astype(np.float32)\n", " array_background = np.zeros_like(array_foreground)\n", " array_background[:, :, :] = (0, 177, 64)\n", " array_foreground_background = array_foreground * array_mask + array_background * (1 - array_mask)\n", " video_writer_subject.write(cv2.cvtColor(array_foreground_background, cv2.COLOR_RGB2BGR).astype(np.uint8))\n", "\n", " video_writer_mask.release()\n", " video_writer_subject.release()\n", "\n", " print('Mask video has been saved to:', video_dst_path_mask)\n", " print('Subject video has been saved to:', video_dst_path_subject)\n", " print('Time cost:', round(time() - time_st, 2))" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "accelerator": "GPU", "colab": { "gpuType": "T4", "provenance": [] }, "kernelspec": { "display_name": "Python 3", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.9.19" }, "widgets": { "application/vnd.jupyter.widget-state+json": { "044920317fb64cd088d49f334930b886": { "model_module": "@jupyter-widgets/base", "model_module_version": "1.2.0", "model_name": "LayoutModel", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "055ec5d0d4da4d1b8df33ddb22d6b55b": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "FloatProgressModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "FloatProgressModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "ProgressView", "bar_style": "success", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_ebf0b02bc7734ebea9a846233a1a6ec4", "max": 298, "min": 0, "orientation": "horizontal", "style": "IPY_MODEL_fb3e80729a214bc5993b62ee04d7c58d", "value": 298 } }, "0ef4b41f8d0141859b7767d112596198": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "HTMLModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HTMLView", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_4480d4d37c2648e7bb5635109b5d4715", "placeholder": "​", "style": "IPY_MODEL_67ce0f56b38941749bdb580a830598c2", "value": " 91.3k/91.3k [00:00<00:00, 1.97MB/s]" } }, "1546b1d7383c4a25b2ab3782ff204cad": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "ProgressStyleModel", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "ProgressStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "bar_color": null, "description_width": "" } }, "1848689bf6a14235b508647d1bdb7f69": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "HTMLModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HTMLView", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_044920317fb64cd088d49f334930b886", "placeholder": "​", "style": "IPY_MODEL_a8416e76428b46c092c7afbf7129b5f9", "value": "BiRefNet_config.py: 100%" } }, "1f1a0c0dc2b74d56b68a779ef944416d": { "model_module": "@jupyter-widgets/base", "model_module_version": "1.2.0", "model_name": "LayoutModel", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "2ad78a6887eb4a369bac75e2436758b9": { "model_module": "@jupyter-widgets/base", "model_module_version": "1.2.0", "model_name": "LayoutModel", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "3b0ddb32ffa442aab3b02a22432bb233": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "HTMLModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HTMLView", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_a124da94c5b143a29d9420eba3954859", "placeholder": "​", "style": "IPY_MODEL_96485cf384484a709e4c32b74e0223af", "value": " 413/413 [00:00<00:00, 5.97kB/s]" } }, "3c9b1a3ed2f64ed58a29083280098292": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "HTMLModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HTMLView", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_cf459ec049624ba29f54cceeb1469785", "placeholder": "​", "style": "IPY_MODEL_db64a13268ab452db1241d06f16d3d6a", "value": " 298/298 [00:00<00:00, 9.24kB/s]" } }, "3e8d434d8e524c8c9f3fe3359df4b327": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "DescriptionStyleModel", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "DescriptionStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "description_width": "" } }, "4480d4d37c2648e7bb5635109b5d4715": { "model_module": "@jupyter-widgets/base", "model_module_version": "1.2.0", "model_name": "LayoutModel", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "4d162f2efc364cf793709f0b9c9dc888": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "HTMLModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HTMLView", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_2ad78a6887eb4a369bac75e2436758b9", "placeholder": "​", "style": "IPY_MODEL_78d3ab060eb64941bcba51fa3b32f493", "value": "model.safetensors: 100%" } }, "4e5fe4296291455f88ae0e5f257c398e": { "model_module": "@jupyter-widgets/base", "model_module_version": "1.2.0", "model_name": "LayoutModel", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "56eb4e5291404f3289196d526fef524f": { "model_module": "@jupyter-widgets/base", "model_module_version": "1.2.0", "model_name": "LayoutModel", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "60d3c15d4b944546992d3517bb73912a": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "ProgressStyleModel", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "ProgressStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "bar_color": null, "description_width": "" } }, "61746c0aaf96444391d1a86ea7223cb0": { "model_module": "@jupyter-widgets/base", "model_module_version": "1.2.0", "model_name": "LayoutModel", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "6588cde28032444980c4e314d6b9a648": { "model_module": "@jupyter-widgets/base", "model_module_version": "1.2.0", "model_name": "LayoutModel", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "6667788f1fa44603a4a04ba8aa5e1cc9": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "HBoxModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HBoxModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HBoxView", "box_style": "", "children": [ "IPY_MODEL_4d162f2efc364cf793709f0b9c9dc888", "IPY_MODEL_e078f8d23e8449e7a9b5771e342febeb", "IPY_MODEL_a330873af8cf45eca95780c50260dbb9" ], "layout": "IPY_MODEL_61746c0aaf96444391d1a86ea7223cb0" } }, "67ce0f56b38941749bdb580a830598c2": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "DescriptionStyleModel", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "DescriptionStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "description_width": "" } }, "688a14cd34704e4ea2e261f6619449ee": { "model_module": "@jupyter-widgets/base", "model_module_version": "1.2.0", "model_name": "LayoutModel", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "6f45e75849f749a1b5fad6e8f7879c8f": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "FloatProgressModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "FloatProgressModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "ProgressView", "bar_style": "success", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_e02fc794fb3645bda6b802277a3e5c1a", "max": 91316, "min": 0, "orientation": "horizontal", "style": "IPY_MODEL_f9a719112f53400782f97d0683862a5f", "value": 91316 } }, "7745af46aa694f5b8ff0ec8fbd72025f": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "DescriptionStyleModel", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "DescriptionStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "description_width": "" } }, "78d3ab060eb64941bcba51fa3b32f493": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "DescriptionStyleModel", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "DescriptionStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "description_width": "" } }, "7bef3ce58df040c986a74eb5334f42c9": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "HBoxModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HBoxModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HBoxView", "box_style": "", "children": [ "IPY_MODEL_1848689bf6a14235b508647d1bdb7f69", "IPY_MODEL_055ec5d0d4da4d1b8df33ddb22d6b55b", "IPY_MODEL_3c9b1a3ed2f64ed58a29083280098292" ], "layout": "IPY_MODEL_b2b95dd8b75d4625ad1bd02a461f304d" } }, "7d19deaab4c845eea4705567bdc65d60": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "HBoxModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HBoxModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HBoxView", "box_style": "", "children": [ "IPY_MODEL_a8941bdff0984189be91fab5bfe1c52c", "IPY_MODEL_b6be81c6cc1e4608a88c785c448bfaa4", "IPY_MODEL_3b0ddb32ffa442aab3b02a22432bb233" ], "layout": "IPY_MODEL_688a14cd34704e4ea2e261f6619449ee" } }, "7fb491d5b8f34a2e842518c1e4ea4906": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "DescriptionStyleModel", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "DescriptionStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "description_width": "" } }, "80a53775d54e47b2922031cc4cd00548": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "HBoxModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HBoxModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HBoxView", "box_style": "", "children": [ "IPY_MODEL_e13013a9d20843bca6da8fe9f0fdb644", "IPY_MODEL_6f45e75849f749a1b5fad6e8f7879c8f", "IPY_MODEL_0ef4b41f8d0141859b7767d112596198" ], "layout": "IPY_MODEL_fecc8e75d8d643759123eaf2ff30fa2a" } }, "8a54f72e65a24d7a93852aca8ecae0a2": { "model_module": "@jupyter-widgets/base", "model_module_version": "1.2.0", "model_name": "LayoutModel", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "96485cf384484a709e4c32b74e0223af": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "DescriptionStyleModel", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "DescriptionStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "description_width": "" } }, "a124da94c5b143a29d9420eba3954859": { "model_module": "@jupyter-widgets/base", "model_module_version": "1.2.0", "model_name": "LayoutModel", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "a330873af8cf45eca95780c50260dbb9": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "HTMLModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HTMLView", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_6588cde28032444980c4e314d6b9a648", "placeholder": "​", "style": "IPY_MODEL_3e8d434d8e524c8c9f3fe3359df4b327", "value": " 885M/885M [00:05<00:00, 192MB/s]" } }, "a8416e76428b46c092c7afbf7129b5f9": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "DescriptionStyleModel", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "DescriptionStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "description_width": "" } }, "a8941bdff0984189be91fab5bfe1c52c": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "HTMLModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HTMLView", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_8a54f72e65a24d7a93852aca8ecae0a2", "placeholder": "​", "style": "IPY_MODEL_7745af46aa694f5b8ff0ec8fbd72025f", "value": "config.json: 100%" } }, "b2b95dd8b75d4625ad1bd02a461f304d": { "model_module": "@jupyter-widgets/base", "model_module_version": "1.2.0", "model_name": "LayoutModel", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "b6be81c6cc1e4608a88c785c448bfaa4": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "FloatProgressModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "FloatProgressModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "ProgressView", "bar_style": "success", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_4e5fe4296291455f88ae0e5f257c398e", "max": 413, "min": 0, "orientation": "horizontal", "style": "IPY_MODEL_60d3c15d4b944546992d3517bb73912a", "value": 413 } }, "cf459ec049624ba29f54cceeb1469785": { "model_module": "@jupyter-widgets/base", "model_module_version": "1.2.0", "model_name": "LayoutModel", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "db64a13268ab452db1241d06f16d3d6a": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "DescriptionStyleModel", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "DescriptionStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "description_width": "" } }, "e02fc794fb3645bda6b802277a3e5c1a": { "model_module": "@jupyter-widgets/base", "model_module_version": "1.2.0", "model_name": "LayoutModel", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "e078f8d23e8449e7a9b5771e342febeb": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "FloatProgressModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "FloatProgressModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "ProgressView", "bar_style": "success", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_1f1a0c0dc2b74d56b68a779ef944416d", "max": 884878856, "min": 0, "orientation": "horizontal", "style": "IPY_MODEL_1546b1d7383c4a25b2ab3782ff204cad", "value": 884878856 } }, "e13013a9d20843bca6da8fe9f0fdb644": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "HTMLModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HTMLView", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_56eb4e5291404f3289196d526fef524f", "placeholder": "​", "style": "IPY_MODEL_7fb491d5b8f34a2e842518c1e4ea4906", "value": "birefnet.py: 100%" } }, "ebf0b02bc7734ebea9a846233a1a6ec4": { "model_module": "@jupyter-widgets/base", "model_module_version": "1.2.0", "model_name": "LayoutModel", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "f9a719112f53400782f97d0683862a5f": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "ProgressStyleModel", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "ProgressStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "bar_color": null, "description_width": "" } }, "fb3e80729a214bc5993b62ee04d7c58d": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "ProgressStyleModel", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "ProgressStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "bar_color": null, "description_width": "" } }, "fecc8e75d8d643759123eaf2ff30fa2a": { "model_module": "@jupyter-widgets/base", "model_module_version": "1.2.0", "model_name": "LayoutModel", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } } } } }, "nbformat": 4, "nbformat_minor": 0 }