MCPcopy Create free account
hub / github.com/biometrics/openbr / load

Method load

openbr/core/core.cpp:148–179  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

146 }
147
148 void load(const QString &model)
149 {
150 // since we are loading an existing model, add its path to the search list for submodels
151 // assuming it is not already present.
152 QFileInfo finfo(model);
153 QString path = finfo.absolutePath();
154 if (!Globals->modelSearch.contains(path))
155 Globals->modelSearch.append(path);
156
157 QtUtils::BlockCompression compressedRead;
158 QFile inFile(model);
159 compressedRead.setBasis(&inFile);
160 QDataStream in(&compressedRead);
161 compressedRead.open(QFile::ReadOnly);
162
163 // Load algorithm
164 transform = QSharedPointer<Transform>(Transform::deserialize(in));
165
166 qint32 mode;
167 in >> mode;
168
169 if (mode == DistanceCompare) {
170 QString distanceDescription;
171 in >> distanceDescription;
172 distance = QSharedPointer<Distance>(Distance::make(distanceDescription, NULL));
173 distance->load(in);
174 comparison = QSharedPointer<Transform>(Transform::make("GalleryCompare", NULL));
175 comparison->setPropertyRecursive("distance", QVariant::fromValue(distance.data()));
176 }
177 if (mode == TransformCompare)
178 comparison = QSharedPointer<Transform>(Transform::deserialize(in));
179 }
180
181 File getMemoryGallery(const File &file) const
182 {

Callers 1

loadModelMethod · 0.45

Calls 8

deserializeFunction · 0.85
makeFunction · 0.85
setBasisMethod · 0.80
containsMethod · 0.45
appendMethod · 0.45
openMethod · 0.45
setPropertyRecursiveMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected