Skip to content

Instantly share code, notes, and snippets.

View botcs's full-sized avatar

Csaba Botos botcs

  • PhD @ Torr Vision Group
  • Oxford, UK
View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import torch\n",
"import numpy as np\n",
class COCOWrapper(object):
"""
Mimics ONLY the basic utilities from pycocotools.coco.COCO class which are
required for and used by pycocotools.coco.COCOeval
The implementation focuses to cover the bare minimum to make the script
running.
"""
def __init__(self, dataset, every_prediction=None):
# follow COCO notation: gt -> ground truth, dt -> detection
import os
import glob
from PIL import Image
import numpy as np
import torch
import torchvision
import random