code stringlengths 3 6.57k |
|---|
assert_array_equal(S, S_exp) |
img.astype(float) |
img_float.astype(img_type) |
max_tree(img_float, connectivity=2) |
assert_array_equal(P, P_exp) |
assert_array_equal(S, S_exp) |
test_area_closing(self) |
Closing (2 thresholds, all types) |
_full_type_test(img, 2, expected_2, area_closing, connectivity=2) |
_full_type_test(img, 4, expected_4, area_closing, connectivity=2) |
max_tree(invert(img) |
test_area_opening(self) |
Opening (2 thresholds, all types) |
_full_type_test(img, 2, expected_2, area_opening, connectivity=2) |
_full_type_test(img, 4, expected_4, area_opening, connectivity=2) |
max_tree(img, connectivity=2) |
test_diameter_closing(self) |
Opening (2 thresholds, all types) |
_full_type_test(img, 2, ex2, diameter_closing, connectivity=2) |
_full_type_test(img, 4, ex4, diameter_closing, connectivity=2) |
max_tree(invert(img) |
test_diameter_opening(self) |
Opening (2 thresholds, all types) |
_full_type_test(img, 2, ex2, diameter_opening, connectivity=2) |
_full_type_test(img, 4, ex4, diameter_opening, connectivity=2) |
max_tree(img, connectivity=2) |
test_local_maxima(self) |
data.astype(dtype) |
max_tree_local_maxima(test_data, connectivity=1) |
assert_array_equal(expected_result, out_bin) |
np.max(out) |
max_tree(test_data) |
assert_array_equal(expected_result, out_bin) |
np.max(out) |
test_extrema_float(self) |
max_tree_local_maxima(data, connectivity=1) |
assert_array_equal(expected_result, out_bin) |
np.max(out) |
test_3d(self) |
np.zeros((8, 8, 8) |
np.zeros((8, 8, 8) |
max_tree_local_maxima(img) |
assert_array_equal(local_maxima, out_bin) |
np.max(out) |
URISC(Dataset) |
super(URISC, self) |
__init__() |
transforms.Normalize(mean=0.520, std=0.185) |
transforms.Normalize(mean=0.518, std=0.190) |
transforms.ToTensor() |
os.path.join(dir, data_rank, mode, filename) |
os.listdir(os.path.join(dir, data_rank, mode) |
RuntimeError(f'No input file found in {os.path.join(dir, data_rank, mode) |
logging.info(f'Creating dataset with {len(self.ids) |
__len__(self) |
len(self.ids) |
__getitem__(self, idx) |
cv2.imread(self.ids[idx]) |
print(image.shape) |
self.transform(image=image) |
image.float() |
contiguous() |
replace(self.mode, "label/"+self.mode) |
cv2.imread(mask_path, cv2.IMREAD_GRAYSCALE) |
print(mask) |
self.transform(image=image, mask=mask) |
self.transform_totensor(transformed_image) |
self.transform_normalize(transformed_image) |
self.transform_totensor(transformed_mask) |
np.transpose(transformed_image, (2, 0, 1) |
np.expand_dims(transformed_mask, axis=0) |
Copyright (C) |
FeatureMatchingLoss(nn.Module) |
__init__(self, criterion='l1') |
super(FeatureMatchingLoss, self) |
__init__() |
nn.L1Loss() |
nn.MSELoss() |
ValueError('Criterion %s is not recognized' % criterion) |
forward(self, fake_features, real_features) |
fake_features (list of lists) |
real_features (list of lists) |
len(fake_features) |
new_tensor(0) |
range(num_d) |
range(len(fake_features[i]) |
detach() |
logging.getLogger(__name__) |
CONF.import_opt('driver_use_ssl', 'cinder.volume.driver') |
CONF.register_opts(d_opts, group=configuration.SHARED_CONF_GROUP) |
six.add_metaclass(utils.TraceWrapperWithABCMetaclass) |
DateraDriver(san.SanISCSIDriver, api2.DateraApi, api21.DateraApi) |
format(VERSION) |
TODO(jsbryant) |
__init__(self, *args, **kwargs) |
super(DateraDriver, self) |
__init__(*args, **kwargs) |
self.configuration.append_config_values(d_opts) |
str(uuid.uuid4() |
utils.setup_tracing(['method']) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.