Comments (5)
For return values, packing all of them into a dictionary may be good. For example, random_flip
returns img, params
, where params
is a dictionary whose keys are x_flip
and y_flip
.
This is good for three reasons.
- There is no ambiguity in the order of variables. On contrary, tuple of variables does (e.g.
params['x_flip']
is self-explanatory). - Length of parameters are constantly one. This was not the case with tuples: three for
random_flip
and five forrandom_expand
. This is good because users do not have to remember the number of parameters. - All intermediate parameters can be called as "params". Therefore, the argument to control whether to return the
params
or not can be fixed toreturn_params
. This solves issue #83.
from chainercv.
@Hakuyume
The code your PRed will be changed with the proposal above. What do you think about it?
from chainercv.
For arguments, following functions are related
image/random_flip
,image/flip
bbox/translate_bbox
bbox/flip_bbox
Although there is an inconsistency, using x_*
, y_*
in this order for arguments is fine. The reasons behind this are
- Variables starting with name
x
andy
are usually inx,y
order because of the order of alphabets. - When they are taken as arguments, there is less likelihood that users mistake order compared to order of return values, which is the initial concern I had when I raised this issue.
The other alternatives would be to make everything consistent. However, I found them to be less convincing.
The first alternative would be to make everything follow y, x
order. However, this would bring up the question of whether to keep order of elements in bounding boxes and keypoints which are currently in x, y
order. In scikit-image, everything including bounding boxes are in y, x
order. I think that using y, x
for bounding boxes and keypoints are very rare conventions.
The second alternative would be to make everything follow x, y
order. This means that image shapes will be represented as W, H
instead of H, W
. I find it increasingly popular to use H, W
in many machine learning communities (e.g. TensorFlow), and I think this convention is more natural especially when working with tensors of shape CHW.
from chainercv.
I agree with you that inconsistency of the order of axis is a problem. I like (col, row)
order, because
- For bboxes and keypoints,
x, y
order is natural. OpenCV
usesx, y
order for its APIs even though it stores images in(row, col)
order.- For example,
cv2.resize
takes(width, height)
as the shape of image
- For example,
from chainercv.
After some discussion internally, I agree that making everything in col, row
order seems to be best.
We need to change resize related functions.
from chainercv.
Related Issues (20)
- Faster RCNN training result problem HOT 2
- Add a img.resize function in utils HOT 2
- A function to return segmented image HOT 2
- no module named 'chainercv.datasets' HOT 6
- Problems of FCIS HOT 6
- Problem about eval_detection HOT 2
- Accuracy problems of FCIS example HOT 5
- loc_normalize_std in ProposalTargetCreator HOT 5
- yolo/train_v3.py does not work HOT 2
- DirectoryParsingLabelDataset fails to read images with an alpha channel
- Allow empty object bounding box for SSD training
- `neg_iou_thresh_lo` value in `ProposalTargetCreator`
- Is it fixed for loading the trained weights for FPN model? HOT 2
- Change Request in chainercv/examples/fpn/train_multi.py HOT 1
- build wheels for chainerCV failed HOT 1
- can't install environment, invalid channel HOT 3
- "Introduction to Chainer" doc link broken
- Request for train.py for YOLO
- eval_semantic_segmentation and calc_semantic_segmentation_confusion for when we have ignore label
- possible bug in the way that mIoU is computed
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chainercv.