This file contains hidden or 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 icevision.visualize.draw_data import draw_bbox | |
| # import a bunch of other stuff here | |
| cmap_path = "zz_color_map_coco.json" | |
| with open(cmap_path) as f: | |
| COLOR_MAP_COCO = json.load(f) | |
| COLOR_MAP_COCO = { | |
| k: np.array(v).astype(np.float) for k, v in COLOR_MAP_COCO.items() | |
| } |
This file contains hidden or 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 torch.nn as nn | |
| import torch | |
| class FocalLoss(nn.Module): | |
| # implementation adapted from https://amaarora.github.io/2020/06/29/FocalLoss.html | |
| # paper: https://arxiv.org/abs/1708.02002 | |
| "Focal Loss" | |
| def __init__(self, alpha=.25, gamma=2, reduction='none', pos_weight=None): | |
| super(FocalLoss, self).__init__() | |
| self.alpha = torch.tensor([alpha, 1-alpha])#.cuda() |
This file contains hidden or 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
| [['color.key.shot.na: 0.9225'], | |
| ['color.saturation.neutral: 0.9356'], | |
| ['color.theory.analagous: 0.8844'], | |
| ['color.tones.warm: 0.8524'], | |
| ['shot.angle.low: 0.8402'], | |
| ['shot.composition.center: 0.9619'], | |
| ['shot.focus.na: 0.7580'], | |
| ['shot.framing.wide: 0.8396'], | |
| ['shot.level.level: 0.9755'], | |
| ['shot.lighting.cast.hard: 0.8004'], |
This file contains hidden or 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
| {'color_key': {'color.key.blue': 0.0003, | |
| 'color.key.green': 0.0001, | |
| 'color.key.luma': 0.0636, | |
| 'color.key.matte': 0.0087, | |
| 'color.key.shot.na': 0.9225, | |
| 'color.key.texture.na': 0.0049}, | |
| 'color_saturation': {'color.saturation.desaturated': 0.0453, | |
| 'color.saturation.neutral': 0.9356, | |
| 'color.saturation.pastel': 0.001, | |
| 'color.saturation.saturated': 0.018}, |
This file contains hidden or 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
| <head> | |
| <!-- Required meta tags --> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | |
| <link rel="stylesheet" href="https://cdn.knightlab.com/libs/juxtapose/latest/css/juxtapose.css"> | |
| </head> | |
| <body> | |
| <div class='juxtapose'> | |
| <img src='https://imgur.com/mfkC86l' /> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
NewerOlder