chainercv icon indicating copy to clipboard operation
chainercv copied to clipboard

Keyword consistency

Open Hakuyume opened this issue 8 years ago • 10 comments

  • [ ] img and imgs
    • img: (C, H, W)
    • imgs: (B, C, H, W) or list/tuple of (C, H, W)
  • [ ] bb, bbox and bboxes
    • bb: (4,)
    • bbox: (R, 4)
    • bboxes: (B, R, 4) or list/tuple of (R, 4).
  • [ ] lb, label and labels
    • lb: ()
    • label: (R,)
    • labels: (B, R) or list/tuple of (R,).
  • [ ] n_noun and n_nouns -> n_noun For the number of something, we use n_noun. For example, n_class and n_bbox (not n_classes and n_bboxes).
  • [ ] label and class -> mainly label We use label for label/class information. The usage of class (cls) is under discussion #130.
  • [ ] conf and score -> score We use score for an array of confidence scores.
  • [ ] pred_noun and gt_noun In functions which require both prediction and ground truth, we mark them by adding prefixes, pred_ and gt_. For example, pred_bboxes and gt_bboxes.
  • [ ] threshold and thresh -> thresh For threshold values, we use thresh. If we use more than one thresholds, we distinguish them by prefixes. For example, nms_thresh and score_thresh.
  • [ ] IoU and Jaccard index -> IoU In documents, we use the Intersection over Union (IoU) or Iou.
  • [ ] split and subset #131 The name of parameter which determines the subset to use. This is under discussion.
  • [ ] For a name of a function or a class, image is used. As a name of a variable inside a function, img is used. For example, FooImage and func_image(img).
  • [ ] rois rois is a (R', 4) which consists of bounding boxes for multiple images. Assuming that there are B images each containing R_i bounding boxes, R' = \sum R_i. rois comes together with a (R',) array called batch_indices, which contains batch indices of images to which bounding boxes correspond to.
  • [ ] In extensions, models are named as target.

Hakuyume avatar May 09 '17 16:05 Hakuyume

I think it is better to unify keywords. I guessed current rules from the codes.

Hakuyume avatar May 09 '17 16:05 Hakuyume

@yuyu2172 How do think of it? Do you know other implicit rules?

Hakuyume avatar May 09 '17 16:05 Hakuyume

Thanks for summarizing this. I have no complaint for everything, but the second one. I think we were discussing on the usage of cls inside eval_detection. I think this is under discussion.

Other than that, here are some that I came up.

  • For a name of a function or a class, image is used. As a name of a variable inside a function, img is used.
  • In extensions, models are named as target.

yuyu2172 avatar May 10 '17 02:05 yuyu2172

@yuyu2172 thank you. I merged the rules you suggested. I changed the state of usage of class to "under discussion".

Hakuyume avatar May 10 '17 02:05 Hakuyume

Copied from #163, these are rules for bounding boxes.

  • bb is a (R,)
  • bbox is a (R, 4)
  • bboxes is a (B, R, 4) or list of (R_i, 4) i=1, ..., B.
  • rois is a (R', 4) which consists of bounding boxes for multiple images. Assuming that there are B images each containing R_i bounding boxes, R' = \sum R_i. rois comes together with a (R',) array called batch_indices, which contains batch indices of images to which bounding boxes correspond to.

For images, a similar rule applies like below.

  • img is a (C, H, W).
  • imgs is a (B, C, H, W) or a list of (C, H, W).

yuyu2172 avatar May 15 '17 08:05 yuyu2172

@yuyu2172 Thank you. I merged them.

Hakuyume avatar May 15 '17 08:05 Hakuyume

I think there is another rule.

  • x is a variable whose shape can be inferred from context. It can be used only when there is no confusion on its shape.

yuyu2172 avatar May 21 '17 16:05 yuyu2172

I think this naming conventions should be included in the documentation.

Here are some rules I found used in ChainerCV.

  • prob is used for probability. If this indicates multi-class probability, cls_prob is also acceptable. For convenience cls_ can be omitted.
  • roi_nouns represents values associated to rois. The shape is (R', ...).
    • In the case when the batchsize=1, variables can be renamed as noun = roi_nouns.

Rules specific to instance segmentation should also be documented.

yuyu2172 avatar Apr 24 '18 01:04 yuyu2172

I think this naming conventions should be included in the documentation.

:+1:

Hakuyume avatar Apr 24 '18 07:04 Hakuyume

Another rule

  • cls_nouns is a multi-class version of nouns.
    • ex: cls_locs is (B, R, L, 4) and locs is (B, R, 4).

yuyu2172 avatar Apr 24 '18 12:04 yuyu2172