Moved MNIST sample to QImage conversion to MNIST loader
parent
eecd7a0fe6
commit
1d343a079a
|
@ -6,6 +6,8 @@
|
|||
#include <memory>
|
||||
#include <inttypes.h>
|
||||
|
||||
#include <QImage>
|
||||
|
||||
class MnistLoader
|
||||
{
|
||||
private:
|
||||
|
@ -21,6 +23,11 @@ public:
|
|||
public:
|
||||
uint8_t label;
|
||||
uint8_t data[SAMPLE_WIDTH * SAMPLE_HEIGHT];
|
||||
|
||||
QImage toQImage() const
|
||||
{
|
||||
return QImage(data, SAMPLE_WIDTH, SAMPLE_HEIGHT, QImage::Format_Grayscale8);
|
||||
}
|
||||
};
|
||||
|
||||
using MnistSample = Sample<SampleWidth, SampleHeight>;
|
||||
|
|
Loading…
Reference in New Issue