资源简介
深度学习网络,用于图像分割和目标检测
代码片段和文件信息
from __future__ import division
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
import numpy as np
from utils import build_targets to_cpu non_max_suppression
import darknet
class Upsample(nn.Module):
“““ nn.Upsample is deprecated “““
def __init__(self scale_factor mode=“bilinear“):
super(Upsample self).__init__()
self.scale_factor = scale_factor
self.mode = mode
def forward(self x):
x = F.interpolate(x scale_factor=self.scale_factor mode=self.modealign_corners=False)
return x
class Emptylayer(nn.Module):
“““Placeholder for ‘route‘ and ‘shortcut‘ layers“““
def __init__(self):
super(Emptylayer self).__init__()
def get_anchors(an
- 上一篇:python爬取微博评论
- 下一篇:跟老齐学python(高清版)
评论
共有 条评论