Recent

Author Topic: Lazarus/FPC CIFAR-10 Support / Unit - 60000 Tiny Images  (Read 3166 times)

schuler

  • Full Member
  • ***
  • Posts: 223
Lazarus/FPC CIFAR-10 Support / Unit - 60000 Tiny Images
« on: June 28, 2017, 12:26:58 am »
:) Hello :)

There is a very interesting project about collecting 60000 tiny 32x32 RGB images and then labeling.
https://www.cs.toronto.edu/~kriz/cifar.html

They make available binary files for download. These files have 10000 images each.

These images are usually used to train their neural networks for image classification/recognition.

In the case that someone might be interested, I coded a fpc/lazarus lib able to load these cifar 10 binary files and save into TImage component objects.

The pascal unit ucifar10.pas is located at:
https://sourceforge.net/p/cai/svncode/HEAD/tree/trunk/lazarus/libs/ucifar10.pas

There are some functions to transform from RGB to Gray and edge detection. Please find attached images.

:) I wish everyone happy coding. :)
« Last Edit: June 28, 2017, 01:20:34 am by schuler »

schuler

  • Full Member
  • ***
  • Posts: 223
Re: Lazarus/FPC CIFAR-10 Support / Unit - 60000 Tiny Images
« Reply #1 on: October 11, 2017, 05:55:19 am »
 :) Hello :)

To whom may concern, there is a fully functional CIFAR 10 classifier code in plain free pascal here:
https://sourceforge.net/p/cai/svncode/HEAD/tree/trunk/lazarus/testcnnalgo/testcnnalgo.lpr

Above code uses convoultional neural networks. In the case that your processor supports AVX and AVX2 instructions (either 32 or 64 bits modes), you can uncomment AVX defines at unit uvolume . Leave these defines commented for a portable code.

In the case that you have never heard about a CIFAR 10 classifier, there is a web browser/javascript version implemented here:
https://cs.stanford.edu/people/karpathy/convnetjs/demo/cifar10.html

As you may presume, a FPC/AVX2 implementation is lightning faster than a javascript implementation.

 :) Have fun :)
« Last Edit: October 11, 2017, 06:00:52 am by schuler »

 

TinyPortal © 2005-2018