Load function Images doesn't recognize file - julia

I'am trying to load an image in Julia using the package Images and the function load.
julia> load("/train/1.bpm")
ERROR: FileIO.File{FileIO.DataFormat{:UNKNOWN}}("/train/1.bpm") couldn't be recognized by FileIO.
I am using Julia 0.4.2.
How can I solve the problem?
Thanks a lot

According to the error statement: FileIO.DataFormat{:UNKNOWN}}("/train/1.bpm"), the file extension is wrong. (bpm used instead of bmp).
Use the correct file format (julia> load("/train/1.bmp")) and you'll be good.

Related

Unable to use calculate_vp for self-made ODIM files using bioRad

I am trying to use bioRad for its use in detection of wildlife and I am converting manually a radar file into ODIM v2.2 to be able to use it. I have converted it and I have verified it with its function, is.pvolfile() as well as H5Fis_hdf5() in order to ensure that it is indeed a hdf file. I converted it manually in python, following the ODIM 2.2 specification. I am able to open the files in the bioRad library in R. I am using R 4.2.1 and has updated the bioRad library to the latest. I would like to use the calculate_vp() function on my radar file which contains 3 scans but it shows the following error:
Warning: failed to read file test7.h5 in ODIM format, ignoring.
Error in processor$process(path.expand(file), config_instance, path.expand(vpfile), :
Could not read file(s)
Does anyone know why this happens? Or how I could solve it? Also, please let me know if there are any missing information.

How to get a screenshot directly into a variable when using R

I use R and the Magick package to process screenshots! Currently, I'm going through an external tool to get my screenshots. This tool gives me a file (png or other) that I have to reload to use it with Magick. Is there a package that would allow me to take screenshots (in whole or only partially) and to retrieve the image directly into a variable without going through an intermediate file? I found plenty of stuff for web-snapshots but nothing for a capture of my screen...
Thanks in advance

Converting warc.gz to .warc

My attempt to extract a warc.gz file, using gzip, resulted in a WARC, but it won't load in http://replayweb.page.
Extracting it using The Unarchiver gave me all the expanded html and other files.
What is the latest recommended method for converting warc.gz to warc? For some reason I am coming up short in my attempts to find suggestions for this simple task.
Thanks!
The programming way is using "warcio" python lib, command-line way is using "warc2warc" utility from warctools.

Torch7 user-defined package not found

I am inside a directory structure where I have:
--train.lua
--utils
--sample.lua
train.lua has got an import line saying require('sample'), however when running the code Torch7 complains with the message
"module 'sample' not found:No LuaRocks module found for sample
I have tried changing instead to require('utils.sample'), but it still crashes. How to overcome this error?
I do not have the problem you described. Could you post the code in the files?
My three files:
main.lua
require 'utils.sample'
help()
utils/sample.lua
function help()
print("help")
end
I using th main.lua to run the code

How to solve this error message in rmarkdown?

I am just starting to explore the rmarkdown package. I don't use Rstudio. I use the default R environment. What I did was as follows.
I created a new R document.
Started typing few lines in rmarkdown format.
Saved the file with Rmd extension.
I saved the file in the working directory.
I installed the pandoc using the pkg file.
I installed 'rmarkdown' package. Loaded the package.
Used the following command to render the Rmd file.
rmarkdown::render("Untitled.Rmd")
I get the following error.
Error in tools::file_path_as_absolute(input) : file 'Untitled.Rmd'
does not exist
I tried all the possible ways such as giving the exact path instead of filename etc. But nothing worked out. I googled the error message and found that none had similar error. Can someone help me with this. What I am missing. What the error message mean?
Most of the time the error file not found is either a type error or a real missing file (as in your case, the real one is named in another way).
In order to discard those possibilities:
Copy the fullpath from your filebrowser.
Make sure the file exists, inside R you could type:
file.exists("/fullpath/to/file")
If that return TRUE and the error persists, then you suspect another thing is going on.

Resources