Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vpr_autoid_check #71

Open
kevinsorochan opened this issue Sep 27, 2024 · 3 comments
Open

vpr_autoid_check #71

kevinsorochan opened this issue Sep 27, 2024 · 3 comments
Assignees

Comments

@kevinsorochan
Copy link
Collaborator

kevinsorochan commented Sep 27, 2024

Describe the bug
the function read_aid_cnn is used within vpr_autoid_check where a "confidence" (i.e., roi probability score) is required. This results in error when processing autoid files without associated probability scores (e.g., threshold = NULL)

vpr_autoid_check(new_autoid = "new_autoid", original_autoid = auto_id_folder, cruise = "CAR2022299", dayhours = "d153.h20")

Error in names(aid_table) <- c("roi", "confidence") :
'names' attribute [2] must be the same length as the vector [1]

@kevinsorochan
Copy link
Collaborator Author

I suggest adding a conditional statement to read_aid_cnn(), such that if there are two columns the second is "confidence"

function(aid_file) {
#' Read aid files produced by automated classification
#'
#' @param aid_file a file path to an aid file produced by automated classification (with ROI path and probability value)
#'
#' @return ROI path and probability values in a table
#' @export
#'
aid_table <- read.table(aid_file, sep = " ")

if (ncol(aid_table) > 1) {

names(aid_table) <- c('roi', 'confidence')

} else {
names(aid_table <- c('roi')

}

return(aid_table)
}

@kevinsorochan
Copy link
Collaborator Author

Suggested soln implemented. Will test next week

c2908d8

@kevinsorochan
Copy link
Collaborator Author

kevinsorochan commented Jan 24, 2025

This seems to work (above) c2908d8

I also had to make changes to other parts of vpr_autoid_check to accommodate a column of probability scores and remove hardcoding for selecting category name: 5e149ba

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant