zaleslaw
12/14/2021, 8:42 AMaltavir
12/14/2021, 4:14 PMmodelhub[...]
Is it a good idea to use get operation for something that could be slow or accesses the disk? Or the cache is loaded in the constructor?Alexandre Brown
12/28/2021, 10:08 PMLoading
instead of a File on disk? Or since preprocessing()
can only be applied to 1 file usually then I guess we could say a ByeArray.asavio
02/18/2022, 7:18 AMВиталий Перятин
02/26/2022, 4:27 PMLudwig Dickmanns
04/18/2022, 12:16 PMFrancis Mariano
04/27/2022, 7:14 PMAlexandre Brown
05/03/2022, 7:00 PMtransformTensor
op that could be done after the rescale for instance ?
I can contribute but want to know if you already did it for 0.4 first.Rishit Dagli
05/11/2022, 4:58 AMAlexandre Brown
05/12/2022, 2:18 AMroman.belov
06/06/2022, 6:18 PMsmallshen
06/25/2022, 10:38 PMAnaniya
07/19/2022, 8:48 PMAnaniya
07/30/2022, 5:48 AMdetectObjects(file: File)
function it was slow as you would normally expect but what got me thinking is instead of loading saving and reloading the image I directly fed the predictRaw(f: FloatArray)
with FloatArray
that came from rescaled and recolored BufferedImage
at this moment the rate of data fed was about 23 BufferedImage
per sec (from my web cam) followed by the predicator which was 111x slower and took 6.02 - 4.4 sec to load single data(FloatArray
)
I wasn't also sure about the Rescaler and color swaper I made but when I did the bench it barely have made any changes even the whole process of converting BufferedImage
to FloatArray
was only having a loss of 1 frames
After all the only thing I could think of is that the predictor instead of getting called from the the mem it's simultaneously being fetched from the storage
If that was the case is there anything that I could do to prevent that
Here's the code in case you are wondering
while(cam.isOpen){
model.predictRaw(cam.image.toFloatArray())
...
Rescribet
08/03/2022, 6:21 AMayodele
08/22/2022, 9:31 PMStefan Oltmann
10/10/2022, 8:02 AMAlexandre Brown
11/08/2022, 3:52 PMAlexandre Brown
11/14/2022, 6:36 PMorg.jetbrains.kotlinx:kotlin-deeplearning-dataset
dependency for commonMain
(multiplatform library) ? ThanksNikita Ermolenko
11/22/2022, 12:46 PMiamsteveholmes
11/23/2022, 2:36 AMStefan Oltmann
12/06/2022, 11:07 AMStefan Oltmann
12/06/2022, 11:16 AMroman.belov
12/14/2022, 12:44 PMholgerbrandl
12/22/2022, 6:19 PMDawid Dębowski
01/06/2023, 2:59 PMfit
function suffice?
Thank you for the answers!Moritz Lindner
01/18/2023, 8:20 PM1.png
in the /images/train/
directory corresponds to 1.txt
in the labels/train
directory.
A txt file is either empty (if no object is in the corresponding image) or contains rows like 0 0.403260 0.570903 0.090604 0.160194
. Each row represents an object labeled in the corresponding image where the first element is the class and the other 4 elements describe the bounding boxes top left and bottom right coordinates.
I want to use the OnHeapDataset
. I was a bit confused regarding the usage of FloatArray everywhere but I think I got the featuresExtractor
working:
featuresExtractor = { basePath ->
println("extracting features in $basePath")
val folder = File(basePath)
val res = folder.listFiles().map { image ->
println("converting ${image.absolutePath}")
val imageWithAlphaChannel = ImageIO.read(image)
val imageWithoutAlphaChannel = BufferedImage(
imageWithAlphaChannel.width,
imageWithAlphaChannel.height,
TYPE_INT_RGB
).apply {
for (x in 0 until imageWithAlphaChannel.width) {
for (y in 0 until imageWithAlphaChannel.height) {
val rgb = imageWithAlphaChannel.getRGB(x, y)
setRGB(x, y, rgb)
}
}
}
pipline.apply(imageWithoutAlphaChannel).first
}.toTypedArray()
println("finished extracting features in $basePath")
res
}
However, I am unsure how to build the labelExtractor
since it awaits (String, Int) -> FloatArray
. So I am am unable to encode the described row structure (containing class, x1, y1, x2, y2) into an FloatArray
as I would need a Array<FloatArray>
to encode the information for the bounding box.
I hope my questions make sens and that I am not completely on the wrong track 😄Paul Woitaschek
01/22/2023, 11:33 AMBastien Leveque
01/22/2023, 5:52 PModay
02/10/2023, 9:58 AM