model package

model module

contains the TextureClassifier class used for predicting the material type of a supplied texture

class model.TextureClassifier(db_path, model_name)[source]

Bases: object

classification_report(info)[source]

process each image in info and compile a classification report for all of them

Parameters:info (DataFrame) – info object which lists images to be processed
Returns:classification report
Return type:DataFrame
get_data(fullpath)[source]

processes image file

Parameters:fullpath (str) – fullpath to image file
Returns:data
Return type:DataFrame
get_results(pred)[source]

converts predictions into results

Parameters:pred (numpy.array) – output of self._model.predict(data)
Returns:list – results
Return type:of dicts
info

compiled information about data in db_path/images and db_path/descriptions.json

Returns:info object
Return type:DataFrame
predict(filepath)[source]

predict the material type of provided image file

Parameters:fullpath (str) – fullpath to image file
Returns:list – results
Return type:of dicts
set_model(filename)[source]

sets TextureClassifier’s internal model to given .pkl model

Returns:None
Return type:None