Giter Site home page Giter Site logo

run pcd_demo.py about fcaf3d HOT 3 CLOSED

samsunglabs avatar samsunglabs commented on June 19, 2024
run pcd_demo.py

from fcaf3d.

Comments (3)

joshiaLee avatar joshiaLee commented on June 19, 2024 1

modify inference.py
like below

def show_det_result_meshlab(data,
result,
out_dir,
score_thr=0.0,
show=False,
snapshot=False
):
"""Show 3D detection result by meshlab."""
points = data['points'][0][0].cpu().numpy()
pts_filename = data['img_metas'][0][0]['pts_filename']
file_name = osp.split(pts_filename)[-1].split('.')[0]

if 'pts_bbox' in result[0].keys():
    pred_bboxes = result[0]['pts_bbox']['boxes_3d'].tensor.numpy()
    pred_scores = result[0]['pts_bbox']['scores_3d'].numpy()
else:
    pred_bboxes = result[0]['boxes_3d'].corners.numpy() # without corners, when visualized the predicted bounding boxes are distorted.
    pred_scores = result[0]['scores_3d'].numpy()
    pred_labels = result[0]['labels_3d'].numpy() # pred_label is an essential parameter when executing _write_oriented_bbox.
# filter out low score bboxes for visualization
if score_thr > 0:
    
    inds = pred_scores > score_thr
    pred_bboxes = pred_bboxes[inds]
    
    

# for now we convert points into depth mode

box_mode = data['img_metas'][0][0]['box_mode_3d']
if box_mode != Box3DMode.DEPTH:
    points = points[..., [1, 0, 2]]
    points[..., 0] *= -1
    show_bboxes = Box3DMode.convert(pred_bboxes, box_mode, Box3DMode.DEPTH)
else:
    show_bboxes = deepcopy(pred_bboxes)

show_result(
    points,
    None,
    None, # extra None is essential
    show_bboxes,
    pred_labels, # pred_label is an essential parameter when executing _write_oriented_bbox
    out_dir,
    file_name,
    show=show,
    snapshot=snapshot)

return file_name

from fcaf3d.

filaPro avatar filaPro commented on June 19, 2024

Please follow #27 .

from fcaf3d.

PengboLi1998 avatar PengboLi1998 commented on June 19, 2024

could you please tell me how to modify it in detail?It was succeseful when I run the test.py,but when I run the pcd_demo.py,it throws the question. Thanks!

from fcaf3d.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.