rationalise images
До Ширина: | Высота: | Размер: 27 KiB После Ширина: | Высота: | Размер: 27 KiB |
После Ширина: | Высота: | Размер: 1.3 KiB |
До Ширина: | Высота: | Размер: 50 KiB После Ширина: | Высота: | Размер: 50 KiB |
До Ширина: | Высота: | Размер: 52 KiB После Ширина: | Высота: | Размер: 52 KiB |
До Ширина: | Высота: | Размер: 74 KiB После Ширина: | Высота: | Размер: 74 KiB |
До Ширина: | Высота: | Размер: 516 KiB После Ширина: | Высота: | Размер: 516 KiB |
|
@ -72,7 +72,7 @@ test_that("Computer Vision endpoint works with local file",
|
|||
{
|
||||
endp <- computervision_endpoint(vision_url, key=vision_key)
|
||||
|
||||
img <- "../resources/bill.jpg"
|
||||
img <- "../../inst/images/bill.jpg"
|
||||
|
||||
res_analyze <- analyze(endp, img)
|
||||
expect_is(res_analyze, "list")
|
||||
|
|
|
@ -43,7 +43,7 @@ test_that("Adding and tagging images works",
|
|||
img_tags <- do.call(rbind.data.frame, img_df$tags)$tagName
|
||||
expect_identical(img_tags, tags)
|
||||
|
||||
img_loc <- add_images(proj, paste0("../resources/", c("can1.jpg", "carton1.jpg")))
|
||||
img_loc <- add_images(proj, paste0("../../inst/images/", c("can1.jpg", "carton1.jpg")))
|
||||
expect_type(img_loc, "character")
|
||||
|
||||
untagged_ids <- list_images(proj, "untagged")
|
||||
|
|
|
@ -59,7 +59,7 @@ test_that("Training endpoint prediction and export works",
|
|||
expect_type(pred1, "character")
|
||||
expect_identical(length(pred1), length(cans))
|
||||
|
||||
pred2 <- predict(mod, "../resources/can1.jpg", type="prob")
|
||||
pred2 <- predict(mod, "../../inst/images/can1.jpg", type="prob")
|
||||
expect_is(pred2, "matrix")
|
||||
expect_type(pred2, "double")
|
||||
expect_identical(dim(pred2), c(1L, 2L))
|
||||
|
@ -68,7 +68,7 @@ test_that("Training endpoint prediction and export works",
|
|||
expect_is(pred3, "list")
|
||||
expect_true(all(sapply(pred3, is.data.frame)))
|
||||
|
||||
expect_error(predict(mod, c(cans, "../resources/can1.jpg")))
|
||||
expect_error(predict(mod, c(cans, "../../inst/images/can1.jpg")))
|
||||
|
||||
exp_url <- export_model(mod, "tensorflow lite", download=FALSE)
|
||||
expect_true(is_url(exp_url))
|
||||
|
|
Двоичные данные
vignettes/bill.jpg
До Ширина: | Высота: | Размер: 71 KiB |
Двоичные данные
vignettes/bill_thumb.jpg
До Ширина: | Высота: | Размер: 1.7 KiB |
|
@ -37,9 +37,9 @@ These are the images we'll use to illustrate how the package works.
|
|||
|
||||
|Filename|Description|Picture|
|
||||
|:------:|:---------:|:-----:|
|
||||
|`bill.jpg`|A portrait of Bill Gates|<img src="bill.jpg" width=300/>|
|
||||
|`park.jpg`|A picture of a city park|<img src="park.jpg" width=300/>|
|
||||
|`gettysburg.jpg`|The text of the Gettysburg Address|<img src="gettysburg.png" width=300/>|
|
||||
|`bill.jpg`|A portrait of Bill Gates|<img src="../inst/images/bill.jpg" width=300/>|
|
||||
|`park.jpg`|A picture of a city park|<img src="../inst/images/park.jpg" width=300/>|
|
||||
|`gettysburg.jpg`|The text of the Gettysburg Address|<img src="../inst/images/gettysburg.png" width=300/>|
|
||||
|
||||
An image to send to the endpoint can be specified as a filename, a publicly accessible Internet URL, or a raw vector. For example, these calls are equivalent, assuming the underlying image is the same:
|
||||
|
||||
|
@ -190,4 +190,4 @@ read_text(vis, "gettysburg.png")
|
|||
```r
|
||||
make_thumbnail(vis, "bill.jpg", "bill_thumb.jpg")
|
||||
```
|
||||
<img src="bill_thumb.jpg"/>
|
||||
<img src="../inst/images/bill_thumb.jpg"/>
|
||||
|
|