lyft / lyft/nuscenes-devkit

Running render_scene in Jupyter notebook throws error

Open
#25 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Jupyter Notebook
Stars
390
Forks
99
PR merge metrics
No merged PRs in 30d

Description

Hey,

I've found an issue related to render_scene function, running it in Jupyter notebook throws following error:

```
---------------------------------------------------------------------------
error Traceback (most recent call last)
in
----> 1 level5data.render_scene(my_scene['token'])

/opt/conda/lib/python3.6/site-packages/lyft_dataset_sdk/lyftdataset.py in render_scene(self, scene_token, freq, imwidth, out_path)
507
508 def render_scene(self, scene_token: str, freq: float = 10, imwidth: int = 640, out_path: str = None) -> None:
--> 509 self.explorer.render_scene(scene_token, freq, image_width=imwidth, out_path=out_path)
510
511 def render_scene_channel(

/opt/conda/lib/python3.6/site-packages/lyft_dataset_sdk/lyftdataset.py in render_scene(self, scene_token, freq, image_width, out_path)
1154
1155 window_name = "{}".format(scene_rec["name"])
-> 1156 cv2.namedWindow(window_name)
1157 cv2.moveWindow(window_name, 0, 0)
1158

error: OpenCV(4.1.0) /io/opencv/modules/highgui/src/window.cpp:610: error: (-2:Unspecified error) The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Cocoa support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script in function 'cvNamedWindow'
```

Running the same function in a python script works perfectly fine.
Here's my Kaggle kernel which you can copy and rerun to produce the error:
https://www.kaggle.com/rishabhiitbhu/eda-understanding-the-dataset

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the Kaggle notebook example and read lyftdataset.py around render_scene, especially the cv2.namedWindow call shown in the traceback. Determine how the Jupyter environment differs from a script, then verify that render_scene completes in a notebook without the reported OpenCV error while still working from a Python script.

Written by the indexing model from the issue text.

Assessment

Tech stack
jupyter-notebook, opencv, python
Domain
computer-vision, data-visualization
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.