Skip to content

Commit

Permalink
benchmark added
Browse files Browse the repository at this point in the history
  • Loading branch information
Tompalski committed Mar 18, 2024
1 parent 2137e4b commit 0eab0d8
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 3 deletions.
20 changes: 18 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,24 @@ See: <http://lastools.org/download/lascanopy_README.txt>
`glcm_IDMN`, `glcm_IDN`, `glcm_inverseVariance`, `glcm_maxProb`,
`glcm_sumAverage`, `glcm_sumEntropy`, `glcm_sumVariance`

Requires the {ForestTools} package. ForestTools::glcm_img() function is
used to calculate the GLCM statistics (see package manual for details)
Requires the {ForestTools} package
(<https://github.com/andrew-plowright/ForestTools>). ForestTools::glcm()
function is used to calculate the GLCM statistics (see package manual
for details)

## Benchmarking

The processing time required for each function in the package varies,
sometimes significantly, depending on the calculations involved. The
figure below presents the average processing time for each `metrics_*`
function included in the package. This benchmark was conducted using the
“Megaplot.laz” dataset from the `lidR` package, with iterative calls to
the `pixel_metrics()` function. It’s important to note that the results
of this benchmark are dependent on the workstation’s specifications and
should be considered as a relative indication of the processing time
required.

![](README_files/figure-gfm/unnamed-chunk-3-1.png)<!-- -->

<!-- ```{r, echo=F, message=FALSE} -->
<!-- library(readxl) -->
Expand Down
22 changes: 21 additions & 1 deletion README.rmd
Original file line number Diff line number Diff line change
Expand Up @@ -187,12 +187,32 @@ http://lastools.org/download/lascanopy_README.txt

`glcm_mean`, `glcm_variance`, `glcm_autoCorrelation`, `glcm_cProminence`, `glcm_cShade`, `glcm_cTendency`, `glcm_contrast`, `glcm_correlation`, `glcm_differenceEntropy`, `glcm_dissimilarity`, `glcm_energy`, `glcm_entropy`, `glcm_homogeneity1`, `glcm_homogeneity2`, `glcm_IDMN`, `glcm_IDN`, `glcm_inverseVariance`, `glcm_maxProb`, `glcm_sumAverage`, `glcm_sumEntropy`, `glcm_sumVariance`

Requires the {ForestTools} package. ForestTools::glcm_img() function is used to calculate the GLCM statistics (see package manual for details)
Requires the {ForestTools} package (https://github.com/andrew-plowright/ForestTools). ForestTools::glcm() function is used to calculate the GLCM statistics (see package manual for details)

## Benchmarking

The processing time required for each function in the package varies, sometimes significantly, depending on the calculations involved. The figure below presents the average processing time for each `metrics_*` function included in the package. This benchmark was conducted using the "Megaplot.laz" dataset from the `lidR` package, with iterative calls to the `pixel_metrics()` function. It's important to note that the results of this benchmark are dependent on the workstation's specifications and should be considered as a relative indication of the processing time required.



```{r, warning=F, echo=F, message=F}
library(tidyverse)
library(bench)
bm2 <- read_csv("results_benchmark.csv")
bm2$median <- bench::as_bench_time(bm2$median)
bm2 <- bm2 %>% mutate(id = fct_rev(factor(id)))
ggplot(bm2, aes(id, median)) +
geom_point() +
geom_segment( aes(x=id, xend=id, y=0, yend=median))+
coord_flip()+
bench::scale_y_bench_time()+
theme_light()+
theme(axis.title = element_blank(),
panel.grid = element_blank())
```



<!-- ```{r, echo=F, message=FALSE} -->
<!-- library(readxl) -->
Expand Down
Binary file added README_files/figure-gfm/unnamed-chunk-3-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 0eab0d8

Please sign in to comment.