Some people asked for a generic glasses classifier (#3, #7, #8), so I released weights for the small eyeglasses classification model. This means you can classify Eyeglasses (sunglasses are excluded) and Anyglasses (sunglasses are included).
Please note that this is just a temporary solution. As noted in #2, the package should be updated in February (non-beta release) with more features, newer models, and better accuracies. Additionally, there will be some architectural changes, thus don't rely on imports or any code used in this beta release - it will be incompatible with v1.0.0.
Unzip and place eyeglasses_classifier_shufflenet_v2_x0_5.pth inside .cache/torch/hub/checkpoints.
Note: your torch hub directory may be elsewhere, you can check that by trying to classify sunglasses. All the models are automatically downloaded there, so just place eyeglasses_classifier_shufflenet_v2_x0_5.pth alongside them.
Setting up Eyeglasses Classification model
About
Some people asked for a generic glasses classifier (#3, #7, #8), so I released weights for the small eyeglasses classification model. This means you can classify
Eyeglasses
(sunglasses are excluded) andAnyglasses
(sunglasses are included).Model
The same model architecture was used as for the small sunglasses classifier, i.e., Shufflenet. The datasets used were Face Attributes Grouped, Face Attributes Extra, and Glasses and Coverings. The results on the test set are as follows:
Note
Please note that this is just a temporary solution. As noted in #2, the package should be updated in February (non-beta release) with more features, newer models, and better accuracies. Additionally, there will be some architectural changes, thus don't rely on imports or any code used in this beta release - it will be incompatible with
v1.0.0
.Setup
Prepare the weights
eyeglasses_classifier_shufflenet_v2_x0_5.pth
inside.cache/torch/hub/checkpoints
.Run the classifier
OR create a custom script, e.g.,
classify_if_glasses.py
:and then just run: