google-research
83 строки · 2.9 Кб
1// Copyright 2024 The Google Research Authors.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15syntax = "proto2";
16
17package keypose;
18
19// 4x4 transform matrix, row major order.
20// Transform is cam_T_world, from world to camera coordinates.
21message Transform {
22repeated float element = 1;
23}
24
25message Camera {
26optional float fx = 1; // In pixels.
27optional float fy = 2;
28optional float cx = 3;
29optional float cy = 4;
30optional float baseline = 5; // In meters.
31optional float resx = 6; // Image resolution in pixels.
32optional float resy = 7;
33}
34
35// Targets are assocated with an image:
36// Transform from world to camera, cam_T_world.
37// Camera parameters.
38// Keypoints in the image.
39message Target {
40optional keypose.Transform transform = 1;
41optional keypose.Camera camera = 2;
42
43message KeyPoint {
44optional float u = 1; // Image coords (pixels) of kp.
45optional float v = 2;
46optional float x = 3; // x,y are normalized image coords of kp, NOT 3D x,y.
47optional float y = 4; // Normalized coords are in [0, 1].
48optional float z = 5; // Distance from camera (m) of kp.
49optional float visible = 6 [default = 1.0]; // 1.0 if kp is onscreen.
50}
51
52repeated KeyPoint keypoints = 3;
53}
54
55// Keypoint and projection targets for an image.
56// This is the top-level pb for stereo samples.
57message KeyTargets {
58optional keypose.Target kp_target = 1;
59repeated keypose.Target proj_targets = 2;
60optional bool mirrored = 3 [default = false];
61}
62
63// Dataset parameters.
64message DataParams {
65// TODO: resx, resy are redundant given the camera.
66optional int32 resx = 1;
67optional int32 resy = 2;
68optional int32 num_kp = 3;
69optional keypose.Camera camera = 4;
70}
71
72// TFRecord sets for training and evaluation
73message TfSet {
74optional string name = 1; // Output will be in keypose/tfrecords/<name>.
75optional string common_dir = 2; // Directory prefix common to all files,
76// e.g. keypose/data/bottle_0.
77repeated string train = 3; // Training tfrecord dirs (e.g. */756x424_fl400).
78repeated string val = 4; // Val tfrecord dirs (texture_5_*/756x424_fl400).
79// Note: val dirs are excluded from train dirs.
80repeated string exclude = 5; // Exclude these dirs from train/val.
81optional string image_size = 6; // Resized image, e.g., 756x424_fl400.
82// fl400 means focal length 400 pixels.
83}
84