Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
bpickens99 authored Jan 15, 2025
1 parent f100b68 commit 089322c
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions MICA annotation methods/1 MICA Images to Annotations.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@

# MICA annotation, part 1, Convert images in a folder to tabular data
# MICA = Move Image Crops for Annotation

# Inputs: code = species identifier
# observ = observer name
# Each folder needs to be labeled: [code]_[observ]
# Please set the 2 input/output working directories below for your study; name will be automatically populated
code = "ROYT"
observ = "bp"

name = paste0(code, "_", observ)

# Set directory that contains these image folders
setwd(file.path('C:', 'Users', 'bpickens','Desktop', 'Crops',
'Annotations_to_process', name))

##list files in a folder
file_list <- list.files ()
file_list

### Change the species = [code]
df = data.frame(species_A = code, object_id_jpg = I(file_list))
df$observer_A <- observ

# Set export directory
setwd(file.path('C:', 'Users', 'bpickens','Desktop', 'Crops'
,'New_annotations'))

name2 <- paste0("table", "_", code, "_", observ, ".csv")

## Write the table to export directory
write.table(df, name2 , col.names=TRUE, row.names=FALSE, sep=",")

View(df)

0 comments on commit 089322c

Please sign in to comment.