FAST  3.2.0
Framework for Heterogeneous Medical Image Computing and Visualization
ImageClassificationNetwork.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include "FAST/ProcessObject.hpp"
4 #include "NeuralNetwork.hpp"
6 #include <queue>
7 
8 namespace fast {
9 
10 // Create the data object used as output from the ImageClassificationNetwork
11 
12 typedef std::map<std::string, float> classifications;
13 FAST_SIMPLE_DATA_OBJECT(ImageClassification, classifications)
14 
15 
18 class FAST_EXPORT ImageClassificationNetwork : public NeuralNetwork {
20  public:
21  void setLabels(std::vector<std::string> labels);
22  void loadAttributes();
23  private:
25  void execute();
26 
27  // A map of label -> score
28  std::vector<std::string> mLabels;
29 
30 };
31 
32 
36 class FAST_EXPORT ClassificationToText : public ProcessObject {
38  private:
39  std::deque<std::map<std::string, float>> mBuffer; // used for calculating temporal average
40  int mBufferSize = 1; // How large the buffer can be
41 
43  void loadAttributes();
44  void execute();
45 };
46 
47 }
fast::classifications
std::map< std::string, float > classifications
Definition: ImageClassificationNetwork.hpp:12
fast
Definition: AffineTransformation.hpp:7
fast::ClassificationToText
Definition: ImageClassificationNetwork.hpp:36
FAST_OBJECT
#define FAST_OBJECT(className)
Definition: Object.hpp:9
NeuralNetwork.hpp
fast::FAST_SIMPLE_DATA_OBJECT
FAST_SIMPLE_DATA_OBJECT(FloatScalar, float)
SimpleDataObject.hpp
ProcessObject.hpp
fast::ImageClassificationNetwork
Definition: ImageClassificationNetwork.hpp:18
fast::NeuralNetwork
Definition: NeuralNetwork.hpp:77
fast::ProcessObject
Definition: ProcessObject.hpp:22