update codes

This commit is contained in:
D-X-Y
2019-02-01 04:03:35 +11:00
parent 3f9b54d99e
commit 65d9c1c57f
11 changed files with 103 additions and 55 deletions

View File

@@ -4,7 +4,6 @@ from .utils import test_imagenet_data
from .utils import print_log
from .evaluation_utils import obtain_accuracy
from .draw_pts import draw_points
from .fb_transform import ApplyOffset
from .gpu_manager import GPUManager
from .save_meta import Save_Meta

View File

@@ -1,14 +0,0 @@
import torch
import random
import numpy as np
class ApplyOffset(object):
def __init__(self, offset):
assert isinstance(offset, int), 'The offset is not right : {}'.format(offset)
self.offset = offset
def __call__(self, x):
if isinstance(x, np.ndarray) and x.dtype == 'uint8':
x = x.astype(int)
if isinstance(x, np.ndarray) and x.size == 1:
x = int(x)
return x + self.offset