This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import base64 | |
import json | |
import os | |
import numpy as np | |
np.random.seed(0) | |
img_file = "lena.png" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
import imgviz | |
import numpy as np | |
import torch | |
class PositionalEmbeddingSinCos(torch.nn.Module): | |
def __init__( | |
self, num_pos_feats=64, temperature=10000, normalize=False, scale=None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from abc import ABC, abstractmethod | |
from typing import Any, List | |
import warnings | |
import numpy as np | |
class Summary(object): | |
def __init__(self, name: str, value: Any): | |
self.name = name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import imgviz | |
import tqdm | |
import corvus_segmentation_models | |
dataset = corvus_segmentation_models.datasets.Warehouse20200526Dataset( | |
split="sim" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import json | |
import imgviz | |
import numpy as np | |
import path | |
import trimesh | |
import trimesh.transformations as tf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
train_pix_mal = 67990163 | |
train_pix_ben = 31488044 | |
train_pix_nor = 38122542 | |
train_pix_out = 1466996531 | |
train_pix_all = train_pix_mal + train_pix_ben + train_pix_nor + train_pix_out | |
valid_pix_mal = 6431428 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import numpy as np | |
import torch | |
import corvus_segmentation_models | |
from train import TransformDataset | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
convert 2004.04336.pdf -thumbnail x256 thumb.png | |
imtile *.png --shape 1x10 --out thumb.png | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import gdown | |
import numpy as np | |
import scipy.io | |
import corvus_segmentation_models | |
mat_file = gdown.cached_download( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import json | |
import numpy as np | |
import path | |
import trimesh | |
import morefusion |