A pytorch implemented classifier for Multiple-Label classification
A pytorch implemented classifier for Multiple-Label classification.
You can easily train
, test
your multi-label classification model and visualize
the training process.
Below is an example visualizing the training of one-label classifier. If you have more than one attributes, no doubt that all the loss and accuracy curves of each attribute will show on web browser orderly.
Loss | Accuracy |
---|---|
data
data.txt
and label.txt
with some predefined format explained below.model
options
util
webvisualizer
: a visdom based visualization tool for visualizing loss and accuracy of each attributeutil
: miscellaneous functions used in projecthtml
: used in webvisualizer.test
mnist
: mnist dataset arranged as defined data format.celeba
: exactract some of attributes of CelebA dataset
Data Format Explanation.
label.txt
Store attribute information including its name and value. label.txt example. Lines in label.txt
stack as follows:
- For each
attribute
:
number of attribute values
;id of attribute
;name attribute
- For each
attribute value
belonging to currentattribute
:
id of attibute_value
;name of attribute value
Note: mind the difference between attribute and attribute value.
data.txt
Store objects information including attribute id and bounding box and so on. Each line is one json dict recording one object. data.txt example
"box"
:object boundingbox.'x'
: top_left.x ,'y'
:top_left.y,'w'
: width of box,'h'
: height of box."image_id"
: image identifier. An image content dependent hash value."box_id"
: object identidier. Combineimage_id
,box['x']
,box['y']
,box['w']
,box["h"]
with_
."size"
: image width and height. Used for varifying whether box is valid."id"
: list of ids. Store multi-label attributes ids, the order is the same as the attributes' order inlabel.txt
Part of codes and models refer to some other OSS listed below for thanks: