Got rid of open3d package (#3)

* Removed using of open3d

* Got rid of open3d package

* Minor refactoring

* Added information to changelog

* Fixed pylint

Co-authored-by: Andrey Zhavoronkov <andrey.v.zhavoronkov@gmail.com>
main
Boris Sekachev 4 years ago committed by GitHub
parent 5b24cf9d74
commit e2ce6ce7d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed ### Fixed
- Task creation progressbar bug (<https://github.com/cvat-ai/cvat/issues/12>) - Task creation progressbar bug (<https://github.com/cvat-ai/cvat/issues/12>)
- Removed Python dependency ``open3d`` which brought different issues to the building process
### Security ### Security
- TDB - TDB

@ -19,7 +19,6 @@ from natsort import os_sorted
from pyunpack import Archive from pyunpack import Archive
from PIL import Image, ImageFile from PIL import Image, ImageFile
from random import shuffle from random import shuffle
import open3d as o3d
from cvat.apps.engine.utils import rotate_image from cvat.apps.engine.utils import rotate_image
from cvat.apps.engine.models import DimensionType, SortingMethod from cvat.apps.engine.models import DimensionType, SortingMethod
@ -820,7 +819,6 @@ MEDIA_TYPES = {
} }
} }
class ValidateDimension: class ValidateDimension:
def __init__(self, path=None): def __init__(self, path=None):
@ -854,6 +852,21 @@ class ValidateDimension:
@staticmethod @staticmethod
def convert_bin_to_pcd(path, delete_source=True): 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 = [] list_pcd = []
with open(path, "rb") as f: with open(path, "rb") as f:
size_float = 4 size_float = 4
@ -863,10 +876,11 @@ class ValidateDimension:
list_pcd.append([x, y, z]) list_pcd.append([x, y, z])
byte = f.read(size_float * 4) byte = f.read(size_float * 4)
np_pcd = np.asarray(list_pcd) np_pcd = np.asarray(list_pcd)
pcd = o3d.geometry.PointCloud()
pcd.points = o3d.utility.Vector3dVector(np_pcd)
pcd_filename = path.replace(".bin", ".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: if delete_source:
os.remove(path) os.remove(path)
return pcd_filename return pcd_filename

@ -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. # archives. Don't use as a python module because it has GPL license.
patool==1.12 patool==1.12
diskcache==5.0.2 diskcache==5.0.2
open3d==0.14.1
boto3==1.17.61 boto3==1.17.61
azure-storage-blob==12.8.1 azure-storage-blob==12.8.1
google-cloud-storage==1.42.0 google-cloud-storage==1.42.0

Loading…
Cancel
Save