Beispiel #1
0
 def get_metrics(self):
     """get runtime time metrics"""
     lp_options = pressio.compressor_get_metrics_results(self._compressor)
     options = _pressio_to_python(lp_options)
     pressio.options_free(lp_options)
     return options
Beispiel #2
0
    input_data = pressio.io_data_from_numpy(floatArray)

    compressed_data = pressio.data_new_empty(pressio.byte_dtype,
                                             pressio.vector_uint64_t())

    dims = pressio.vector_uint64_t([height, width, 3])

    decompressed_data = pressio.data_new_empty(pressio.double_dtype, dims)

    #compress data with selected compressor
    pressio.compressor_compress(compressor, input_data, compressed_data)
    #decompress data with selected compressor
    pressio.compressor_decompress(compressor, compressed_data,
                                  decompressed_data)
    #get metric results for compression
    metric_results = pressio.compressor_get_metrics_results(compressor)

    #Grab relevant compression metrics
    compression_ratio = pressio.new_double()
    compressed_size = pressio.new_uint32()
    uncompressed_size = pressio.new_uint32()
    decompressed_size = pressio.new_uint32()
    pressio.options_get_double(metric_results, b"size:compression_ratio",
                               compression_ratio)
    pressio.options_get_uinteger(metric_results, b"size:compressed_size",
                                 compressed_size)
    pressio.options_get_uinteger(metric_results, b"size:uncompressed_size",
                                 uncompressed_size)
    pressio.options_get_uinteger(metric_results, b"size:decompressed_size",
                                 decompressed_size)