forked from noahcao/Pixel2Mesh
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtmp.py
30 lines (23 loc) · 954 Bytes
/
tmp.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import logging
import pickle
from logging import getLogger
from pathlib import Path
logging.basicConfig(
format="[%(asctime)s][%(levelname)s][%(filename)s:%(lineno)d] - %(message)s",
level=logging.WARNING,
)
logger = getLogger(__name__)
logger.setLevel(logging.INFO)
if __name__ == "__main__":
pkl_path: Path = Path("/media/data_hdd/hiroakisugisaki/data/dataset/ShapeNet_for_P2M/ShapeNetP2M/02691156/10155655850468db78d106ce0a280f87/rendering/01.dat")
if not pkl_path.exists():
raise FileNotFoundError(f"{pkl_path}")
with open(pkl_path, mode="rb") as f:
data = pickle.load(f, encoding="latin1")
logger.info(f"type(data)={type(data)}")
logger.info(f"data.shape={data.shape}")
pts, normals = data[:, :3], data[:, 3:]
logger.info(f"type(pts)={type(pts)}")
logger.info(f"pts.shape={pts.shape}")
logger.info(f"type(normals)={type(normals)}")
logger.info(f"normals.shape={normals.shape}")