diff --git a/CHANGELOG.md b/CHANGELOG.md index b10e28c4..9cb15878 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Task creation progressbar bug () +- Removed Python dependency ``open3d`` which brought different issues to the building process ### Security - TDB diff --git a/cvat/apps/engine/media_extractors.py b/cvat/apps/engine/media_extractors.py index 1a7fa04d..716b9b66 100644 --- a/cvat/apps/engine/media_extractors.py +++ b/cvat/apps/engine/media_extractors.py @@ -19,7 +19,6 @@ from natsort import os_sorted from pyunpack import Archive from PIL import Image, ImageFile from random import shuffle -import open3d as o3d from cvat.apps.engine.utils import rotate_image from cvat.apps.engine.models import DimensionType, SortingMethod @@ -820,7 +819,6 @@ MEDIA_TYPES = { } } - class ValidateDimension: def __init__(self, path=None): @@ -854,6 +852,21 @@ class ValidateDimension: @staticmethod def convert_bin_to_pcd(path, delete_source=True): + def write_header(fileObj, width, height): + fileObj.writelines(f'{line}\n' for line in [ + 'VERSION 0.7', + 'FIELDS x y z', + 'SIZE 4 4 4', + 'TYPE F F F', + 'COUNT 1 1 1', + f'WIDTH {width}', + f'HEIGHT {height}', + 'VIEWPOINT 0 0 0 1 0 0 0', + f'POINTS {width * height}', + 'DATA binary', + ]) + + list_pcd = [] with open(path, "rb") as f: size_float = 4 @@ -863,10 +876,11 @@ class ValidateDimension: list_pcd.append([x, y, z]) byte = f.read(size_float * 4) np_pcd = np.asarray(list_pcd) - pcd = o3d.geometry.PointCloud() - pcd.points = o3d.utility.Vector3dVector(np_pcd) pcd_filename = path.replace(".bin", ".pcd") - o3d.io.write_point_cloud(pcd_filename, pcd) + with open(pcd_filename, "w") as f: + write_header(f, np_pcd.shape[0], 1) + with open(pcd_filename, "ab") as f: + f.write(np_pcd.astype('float32').tobytes()) if delete_source: os.remove(path) return pcd_filename diff --git a/cvat/requirements/base.txt b/cvat/requirements/base.txt index 72db5421..0accbca6 100644 --- a/cvat/requirements/base.txt +++ b/cvat/requirements/base.txt @@ -42,7 +42,6 @@ tensorflow==2.8.0 # Optional requirement of Datumaro. Use tensorflow-macos==2.8. # archives. Don't use as a python module because it has GPL license. patool==1.12 diskcache==5.0.2 -open3d==0.14.1 boto3==1.17.61 azure-storage-blob==12.8.1 google-cloud-storage==1.42.0