<jupyter_start><jupyter_text>**Y**ou **O**nly **L**ook **A**t **C**oefficien**T**s```    ██╗   ██╗ ██████╗ ██╗      █████╗  ██████╗████████╗    ╚██╗ ██╔╝██╔═══██╗██║     ██╔══██╗██╔════╝╚══██╔══╝     ╚████╔╝ ██║   ██║██║     ███████║██║        ██║         ╚██╔╝  ██║   ██║██║     ██╔══██║██║        ██║          ██║   ╚██████╔╝███████╗██║  ██║╚██████╗   ██║          ╚═╝    ╚═════╝ ╚══════╝╚═╝  ╚═╝ ╚═════╝   ╚═╝ ```A simple, fully convolutional model for real-time instance segmentation. This is the code for our papers: - [YOLACT: Real-time Instance Segmentation](https://arxiv.org/abs/1904.02689) - [YOLACT++: Better Real-time Instance Segmentation](https://arxiv.org/abs/1912.06218) YOLACT++ (v1.2) released! ([Changelog](CHANGELOG.md))YOLACT++'s resnet50 model runs at 33.5 fps on a Titan Xp and achieves 34.1 mAP on COCO's `test-dev` (check out our journal paper [here](https://arxiv.org/abs/1912.06218)).[GitHub](https://github.com/dbolya/yolact)> Colab author: [mrm8488](https://twitter.com/mrm8488)  Install required packages<jupyter_code># Cython needs to be installed before pycocotools
!pip install cython
!pip install opencv-python pillow pycocotools matplotlib<jupyter_output><empty_output><jupyter_text>Clone the repository<jupyter_code>!git clone https://github.com/dbolya/yolact.git
cd yolact
!mkdir weights<jupyter_output><empty_output><jupyter_text>Download the model weights<jupyter_code>!gdown "https://drive.google.com/uc?id=15id0Qq5eqRbkD-N3ZjDZXdCvRyIaHpFB&export=download" -O "./weights/yolact_plus_base_54_800000.pth"
cd external/DCNv2<jupyter_output><empty_output><jupyter_text>Compile deformable convolutional layers (from DCNv2) to use YOLACT++ version<jupyter_code>!python setup.py build develop &> /dev/null
cd /content/yolact/
!mkdir uploads
!mkdir results<jupyter_output><empty_output><jupyter_text>Upload files from local filesystem<jupyter_code>from google.colab import files

uploaded = files.upload()
pic_names = list(uploaded.keys())
for pic_name in pic_names:
  print(pic_name)
  !mv ./$pic_name ./uploads/$pic_name<jupyter_output><empty_output><jupyter_text>Detect objects in the uploaded pictures<jupyter_code>!python eval.py --trained_model=weights/yolact_plus_base_54_800000.pth --score_threshold=0.15 --top_k=15 --images=./uploads:./results<jupyter_output><empty_output><jupyter_text>Display results<jupyter_code>from IPython.display import display, Image
import os

for filename in os.listdir("./results/"):
    print(filename)
    if filename.endswith(".png"):
      img = Image("./results/"+filename)
      display(img)<jupyter_output><empty_output><jupyter_text>Zip and download the results<jupyter_code>!zip -r /content/results_images.zip ./results
from google.colab import files
files.download("/content/results_images.zip")<jupyter_output><empty_output>
StarcoderdataJupyterStructuredCleanDedup