123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120 |
- #ifndef _NICE_IMAGENETDATAINCLUDE
- #define _NICE_IMAGENETDATAINCLUDE
- #ifdef NICE_USELIB_MATIO
- #include <string>
- #include <core/vector/VectorT.h>
- #include <core/vector/SparseVectorT.h>
- #include <core/matlabAccess/MatFileIO.h>
- #include "vislearning/cbaselib/LabeledSet.h"
- namespace NICE {
-
- class ImageNetData
- {
- protected:
- std::string imageNetRoot;
- std::vector< SparseVector > XPreload;
- Vector yPreload;
- public:
-
- ImageNetData( const std::string & imageNetRoot = "/home/dbv/bilder/imagenet/devkit-1.0/demo/" );
-
-
- virtual ~ImageNetData();
-
- void getBatchData ( sparse_t & data, Vector & y, const std::string & fileTag = "train", const std::string & variableTag = "training" );
-
- void preloadData ( const std::string & fileTag = "val", const std::string & variableTag = "testing" );
-
-
- void normalizeData ( const std::string & normTag = "L1" );
-
-
-
- void loadDataAsLabeledSetVector( OBJREC::LabeledSetVector & lsVector, const std::string & fileTag = "train", const std::string & variableTag = "training" );
-
- const SparseVector & getPreloadedExample ( int index ) const;
-
- double getPreloadedLabel ( int index ) const;
-
- int getNumPreloadedExamples () const;
-
-
- void loadExternalLabels ( const std::string & fn, int n = -1 );
-
- std::vector< SparseVector > getPreloadedData() { return XPreload;};
- NICE::Vector getPreloadedLabels()const {return yPreload;};
- };
- }
- #endif
- #endif
|