code
stringlengths
3
6.57k
FramePerSec.tick(FPS)
generator(data, batch_size, img_cols, img_rows, img_ch)
list(range(0, data[0].shape[0], batch_size)
load_batch([l[it:it + batch_size] for l in data], img_cols, img_rows, img_ch)
test_big(args)
print("Names to test: {}".format(names_path)
print("Dataset: {}".format(names_path)
print("Weights: {}".format(weights_path)
get_eye_tracker_model(img_cols, img_rows, img_ch)
model.summary()
print("Loading weights...")
load_model(weights_path)
model.load_weights(weights_path)
load_data_names(names_path)
print("Loading testing data...")
list(range(0, len(test_names)
load_batch_from_names_random(test_names[it:it + chunk_size], dataset_path, batch_size, img_cols, img_rows, img_ch)
load_batch_from_names(test_names[it:it + chunk_size], dataset_path, img_ch, img_cols, img_rows)
model.predict(x=x, batch_size=batch_size, verbose=1)
enumerate(predictions)
print("PR: {} {}".format(prediction[0], prediction[1])
print("GT: {} {} \n".format(y[i][0], y[i][1])
err_x.append(abs(prediction[0] - y[i][0])
err_y.append(abs(prediction[1] - y[i][1])
np.mean(err_x)
np.mean(err_y)
np.std(err_x)
np.std(err_y)
print("MAE: {} {} ( samples)
format(mae_x, mae_y)
print("STD: {} {} ( samples)
format(std_x, std_y)
test_big()
os.statvfs()
DiskSpaceCollector(diamond.collector.Collector)
get_default_config_help(self)
super(DiskSpaceCollector, self)
get_default_config_help()
get_default_config(self)
super(DiskSpaceCollector, self)
get_default_config()
process_config(self)
super(DiskSpaceCollector, self)
process_config()
isinstance(self.exclude_filters, basestring)
re.compile('!.*')
re.compile('|'.join(self.exclude_filters)
isinstance(self.config['filesystems'], basestring)
split(',')
self.filesystems.append(filesystem.strip()
isinstance(self.config['filesystems'], list)
get_disk_labels(self)
os.path.isdir(path)
os.listdir(path)
label.replace('\\x2f', '/')
os.path.realpath(path + '/' + label)
get_file_systems(self)
iostat(1)
FileSystem(device, mount_point)
os.access('/proc/mounts', os.R_OK)
open('/proc/mounts')
line.split()
except (IndexError, ValueError)
self.exclude_reg.search(mount_point)
if ((('/' in device or ':' in device or device == 'tmpfs')
mount_point.startswith('/')
os.stat(mount_point)
os.path.realpath(device)
file.close()
self.log.error('Unable to import psutil')
psutil.disk_partitions(False)
len(result)
os.path.realpath(partition.device)
collect(self)
self.get_disk_labels()
self.get_file_systems()
self.log.error('No diskspace metrics retrieved')
results.itervalues()
replace('/', '_')
name.replace('.', '_')
replace('\\', '')
hasattr(os, 'statvfs')
os.statvfs(info['mount_point'])
self.log.exception(e)
psutil.disk_usage(info['mount_point'])
NotImplementedError("platform not supported")
float(blocks_free)
self.publish_gauge(metric_name, metric_value, 2)
float(block_size)
self.publish_gauge(metric_name, metric_value, 2)
float(block_size)
float(blocks_free)
self.publish_gauge(metric_name, metric_value, 2)
float(block_size)
float(blocks_avail)
self.publish_gauge(metric_name, metric_value, 2)
float(inodes_total)
float(inodes_free)
float(inodes_total)
self.publish_gauge('%s.inodes_free' % name, inodes_free)