Skip to content

Commit 3ead917

Browse files
committed
Magick to base loader (#299)
1 parent 3527acd commit 3ead917

File tree

6 files changed

+6
-8
lines changed

6 files changed

+6
-8
lines changed

DESCRIPTION

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ Suggests:
6262
igraph,
6363
jsonlite,
6464
knitr,
65-
magick,
6665
mlr3tuning (>= 1.0.0),
6766
progress,
6867
rmarkdown,

R/LearnerTorchImage.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ LearnerTorchImage = R6Class("LearnerTorchImage",
3131
#' @description
3232
#' Creates a new instance of this [R6][R6::R6Class] class.
3333
initialize = function(id, task_type, param_set = ps(), label, optimizer = NULL, loss = NULL,
34-
callbacks = list(), packages = c("torchvision", "magick"), man, properties = NULL,
34+
callbacks = list(), packages = "torchvision", man, properties = NULL,
3535
predict_types = NULL) {
3636
properties = properties %??% switch(task_type,
3737
regr = c(),

R/utils.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ dataset_image = dataset("image_dataset",
178178
self$uris = uris
179179
},
180180
.getitem = function(x) {
181-
list(x = torchvision::transform_to_tensor(magick::image_read(self$uris[x])))
181+
list(x = torchvision::transform_to_tensor(torchvision::base_loader(self$uris[x])))
182182
},
183183
.length = function() {
184184
length(self$uris)

man/mlr_learners.torchvision.Rd

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/mlr_learners_torch_image.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/testthat/test_LearnerTorchVision.R

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ test_that("LearnerTorchVision basic checks", {
1717
vgg13$id = "a"
1818
expect_false(alexnet$phash == vgg13$phash)
1919
expect_true("torchvision" %in% alexnet$packages)
20-
expect_true("magick" %in% alexnet$packages)
2120

2221
alexnet = lrn("classif.alexnet", optimizer = "sgd", loss = "cross_entropy",
2322
callbacks = t_clbk("checkpoint"), epochs = 0, batch_size = 1

0 commit comments

Comments
 (0)