Skip to content

Commit

Permalink
Add video_scores function and update image_scores function
Browse files Browse the repository at this point in the history
  • Loading branch information
atomashevic committed Dec 7, 2023
1 parent 3c22afa commit 5a3b2d8
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 7 deletions.
9 changes: 9 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,21 @@ export(setup_miniconda)
export(setup_modules)
export(simulate_video)
export(transformer_scores)
export(video_scores)
import(reticulate)
importFrom(Matrix,bdiag)
importFrom(base,file.remove)
importFrom(base,paste0)
importFrom(dplyr,left_join)
importFrom(reticulate,py_module_available)
importFrom(reticulate,source_python)
importFrom(reticulate,use_condaenv)
importFrom(stats,aggregate)
importFrom(stats,grep)
importFrom(stats,na.omit)
importFrom(utils,data)
importFrom(utils,dir.create)
importFrom(utils,dir.exists)
importFrom(utils,install.packages)
importFrom(utils,installed.packages)
importFrom(utils,packageDescription)
Expand Down
8 changes: 3 additions & 5 deletions R/video_scores.R
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,8 @@ video_scores <- function(video, classes, nframes=100,
setup_modules()
}
################################################################
# source_python(system.file("python", "image.py", package = "transforEmotion"))
# source_python(system.file("python", "image.py", package = "transforEmotion"))
reticulate::source_python("inst/python/image.py")
reticulate::source_python("inst/python/video.py")
source_python(system.file("python", "image.py", package = "transforEmotion"))
source_python(system.file("python", "image.py", package = "transforEmotion"))
if (!grepl("youtu", video)){
stop("You need to provide a YouTube video URL.")
}
Expand Down Expand Up @@ -84,4 +82,4 @@ video_scores <- function(video, classes, nframes=100,
file.remove(list.files(save_dir, pattern = ".jpg"))
}
return(result)
}
}
4 changes: 2 additions & 2 deletions man/image_scores.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

60 changes: 60 additions & 0 deletions man/video_scores.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5a3b2d8

Please sign in to comment.