Commit graph

164 commits

Author SHA1 Message Date
Candice Bentéjac
7fc52f2028 [ui] Check for the existence of the poses key before accessing it
When parsing the input JSON file, there might be some instances where
the `poses` key, unlike the `views` and `intrinsics` keys, does not exist.
If that is the case, an unhandled exception is raised while connections
are being made, which then causes issues for the lifetime of the Meshroom
instance.

This commit checks that the key exists before trying to access it, which
prevents raising unhandled exceptions while the active project is being
set up.
2023-09-15 17:12:39 +02:00
Loïc Vital
4c58d4b93f [ui] new concept of pickedViewId to scroll in 2D viewer without constantly updating selectedViewId 2023-07-12 09:13:51 +02:00
Loïc Vital
8a3daed543 [ui] sequence player: draw cached frames indicator 2023-07-12 09:13:50 +02:00
Candice Bentéjac
cef8cf6fd8
Merge pull request #1924 from alicevision/mug/refactoQtAV
[ui] Reflect changes made in QtAliceVision refactorize PR
2023-05-26 14:57:36 +02:00
Loïc Vital
2bf1a5f809 [ui] Viewer2D: notion of feature/match provider nodes for features viewer 2023-05-10 17:17:58 +02:00
Candice Bentéjac
76329b88e0 [ui] Update input to the KeyframeSelection node when a video is dropped 2023-04-12 15:01:14 +02:00
Loïc Vital
8d68f17410 [ui] MFeatures: use viewId from active cameraInit only (not all cameraInits) 2023-03-22 15:43:54 +01:00
Candice Bentéjac
59be396244 [ui] Prevent editing the intrinsics of temporary CameraInit nodes
As the temporary CameraInit nodes are not really part of the graph, their
attributes cannot be edited. By default, the intrinsics can be edited for
any CameraInit node from the intrinsics table.

For temporary CameraInit nodes, we want the intrinsics to be displayed in
read-only mode to ensure that the user cannot attempt to edit them, which
would cause errors.

Upon its creation, the temporary CameraInit node is locked (as if it were
computed), and the intrinsics table's component are updated to be displayed
as read-only if the CameraInit node is locked.
2023-03-15 10:00:19 +01:00
Candice Bentéjac
4001c4fc3e [ui] Update active CameraInit's index when loading a LdrToHdrMerge node
If a LdrToHdrMerge node does not belong to the active group but is set as
active (by loading it with a double-click), if it is connected to another
CameraInit node, and if the "Visualize HDR images" has been enabled, then
the active group should be updated to that other CameraInit node.

By updating the active CameraInit's index, not only will the Image Gallery
display the newly selected LdrToHdrMerge thumbnails (already working prior
to this commit), but the Viewer2D will also be updated to reflect the
Gallery's selected thumbnail correctly. Information provided by the Gallery
will also reflect its content, as the active group will correspond to the
shown images, which was not the case before.
2023-03-13 15:57:23 +01:00
Loïc Vital
31b04092a0 [ui] update QML properties after changes in qtAV 2023-03-08 17:18:03 +01:00
Candice Bentéjac
4b2857be9b [ui] Add a "Load Template" action in the "Advanced" menu
"Load Template" allows to load an .mg file as a regular project file,
without taking into account if it is a template.

If the project file is not a template, it will be opened exactly as if the
"Open File" menu had been used. If it is a template and it contains
"Publish" nodes, they will not be filtered out (whereas they will be if
the template is opened with "Open File" or through the "New" actions).
2023-03-06 11:12:05 +00:00
Candice Bentéjac
99b82e601f Ignore "Publish" nodes when loading a template unless specified otherwise
This commit adds an option to the "load" method, "publishOutputs", that
determines whether "Publish" nodes in a template project file should be
ignored during the graph's creation.

If "publishOutputs=True", then the "Publish" nodes from the template will
be added to the graph. "Publish" nodes in a project file that is not
a template will not be affected by this and will always be added to the
graph, as any other node.

This allows to have templates that are compatible with meshroom_batch,
which requires a "Publish" node when the --output option is specified,
while not having unneeded nodes in the UI or unneeded operations:
when --output is specified in meshroom_batch, "publishOutputs=True",
otherwise it will be set to False so that the "Publish" nodes are not
executed needlessly.
2023-02-27 18:34:51 +01:00
Candice Bentéjac
1576bfd43d [ui] Check that viewpoints still exist before accessing their metadata
The metadata value of the viewpoint is meant to be a string, but if the
viewpoint attribute has already been removed and does not exist anymore,
then the metadata value becomes a PySide property.

When trying to access that property, an exception is raised. This commit
avoids raising exceptions in that case by checking that the viewpoint
attribute still exists (the metadata value is a string instance) before
accessing the metadata value.

This fixes the "Failed to parse Viewpoint metadata: 'the JSON object must
be str, bytes or bytearray, not Property'" warning raised by the exception
which occurred every single time there was a switch between cameraInit
groups that had been cleared.
2023-02-15 18:01:40 +01:00
Fabien Castan
1fc2b228af
Merge pull request #1896 from alicevision/fix/dragDropImages
[ui] Drag&Drop: Use a pool of threads for asynchronous intrinsics computations
2023-02-14 21:23:27 +01:00
Candice Bentéjac
246843a769 [ui] Reconstruction: Use a ThreadPool for asynchronous computations
When importing images, the intrinsics were (re)built asynchronously in
a thread that was not attached to anything. The update of the intrinsics,
performed in the main thread following a signal emitted in the detached
thread, would block when there were already some existing intrinsics
because the garbage collector would destroy the thread in which the
new intrinsics had been computed while the update was ongoing.

This commit adds a ThreadPool to the Reconstruction object, and uses it
to perform the intrinsics computations asynchronously. The update of the
intrinsics thus does not remain blocked and images can be imported safely,
either though the "Import Images" menu or through drag & drop.

The "Update Intrinsics" button, which appears when the dialog to edit the
sensor database is on display, also uses the ThreadPool to recompute the
intrinsics when requested.

The "runAsync" method, which spawned a thread without attaching it to
anything, is removed. The "importImagesAsync" method, whose only goal
was to call "runAsync" on "importImagesSync", is also removed. Instead,
the pool of threads is directly used to call "importImagesSync"
asynchronously.
2023-02-14 17:26:36 +01:00
Candice Bentéjac
b5fab79e09 [ui] Import images asynchronously with the "Import Images" menu action
Loading images with the "Import Images" menu action is a blocking
operation that might freeze the app if there are many images to import.

This commit performs the import asynchronously (similarly to what is done
when images are dropped in the Image Gallery): Meshroom remains unusable
while the images are imported and the intrinsics built (which is a wanted
behaviour), but it does not freeze at all.
2023-02-14 17:23:29 +01:00
mugulmd
a52aeabedb [ui] 3D viewer: correct field of view using orientation tag 2023-02-06 08:37:30 -08:00
mugulmd
205ff22b74 [ui] apply orientation tag to 3d scene to match 2d viewer 2023-02-06 06:09:37 -08:00
mugulmd
21f43075f0 [ui] fix transform used for camera in 3D viewer 2023-02-01 09:22:18 -08:00
Candice Bentéjac
8bef398bed Remove workarounds and backports for Python 2 support
In particular:
- In common/, remove the backport of weakref.WeakMethod
- In docs/ and ui/, use the standard FileNotFoundError class
- Use built-in open() instead of io.open(), and stop importing io
- In core/stats.py, use the standard implementation of xml.etree instead
of the C one
2022-12-05 17:16:21 +01:00
Candice Bentéjac
635f85e7fd Remove all references to pyCompatibility
- "pyCompatibility.basestring" are replaced by standard Python3 "str"
- "Sequence" and "Iterable" from "collections" are now directly imported
with "collections.abc"
2022-12-05 17:16:21 +01:00
Candice Bentéjac
eac43c84c3 [submitters] Add an option to update the job title on submitters 2022-12-05 15:23:10 +01:00
Loïc Vital
426cdbe50b [ui] use tempCameraInit node to get viewpoints when it exists 2022-10-19 09:50:24 +01:00
Candice Bentéjac
9c41ce2401 [ui] ImageGallery: update group index when CameraInit node is double-clicked
If a node of type "CameraInit" is double-clicked in the Graph Editor,
the Image Gallery group index will immediately be updated to display
the corresponding node's information.
2022-09-02 19:19:28 +02:00
Fabien Castan
25cb8f80d8
Merge branch 'develop' into fix-pyside2-decorator-bug 2022-07-28 10:31:01 +02:00
Fabien Castan
b291a9ed07
Merge pull request #1727 from alicevision/dev/externalPipelines
Use project files to define pipelines
2022-07-26 15:06:16 +02:00
Candice Bentéjac
f2a904ac9b Fix compatibility with Python 3
- Import "collections" correctly depending on the version of
Python
- Fix regex that raised deprecation warnings in Python 3
2022-07-19 14:52:18 +02:00
Candice Bentéjac
8fb0c778d1 Add support for external pipelines using project files
- Support loading external pipelines as templates with project files
- Add template files for some standard pipelines
- Remove the hard-coded generation of new pipelines
- Update multiviewPipeline test: the multiviewPipeline test relied on the hard-coded generation of
pipelines.
2022-07-12 14:56:24 +02:00
Povilas Kanapickas
e725f599c5 [ui] Work around PySide2 bug affecting property decorators
PySide 5.15.1 and newer have a bug
(https://bugreports.qt.io/browse/PYSIDE-1426) which results in the
following error emitted on certain @Property decorators:

TypeError: A constant property cannot have a WRITE method or a NOTIFY
signal.

Until the bug is fixed on PySide2 side workaround is to not use Property
as a decorator, but as a simple function wrapper emitting the property
as a class member.

Fixes #1239.
2022-07-08 01:00:43 +03:00
Fabien Castan
7b467b649d fix: force float conversion 2022-06-02 14:15:18 +02:00
fabien servant
655dad9959 [camerainit] update parameters to use focal in mm 2022-03-25 11:07:52 +01:00
Fabien Castan
cd15a92318
[ui] fix uvCenterOffset
Fix changes of principal point coord system from https://github.com/alicevision/meshroom/pull/1509.
2021-10-14 14:32:00 +02:00
Nils Landrodie
3fad2faa87 [multi] Add new active node category and pass id view to disto viewer 2021-09-14 18:07:33 +02:00
Remy Mellet
d30571ce7d Draft Reconstruction pipeline 2021-09-13 10:36:46 +02:00
Fabien
cc99906dae [sfm] dirty quick fix for anamorphic pxFocalLength 2021-05-28 15:53:24 +02:00
Fabien Castan
1999b7c5b2 [multiview] New pipeline Photogrammetry and Camera Tracking 2021-05-27 17:02:39 +02:00
Fabien Castan
cbdad2d7e6
Merge pull request #1379 from alicevision/dev/cameraTrackingPipeline
New experimental camera tracking pipeline
2021-05-03 12:04:04 +02:00
Fabien Castan
a17fdf33b5 [ui] reconstruction: remove dead code 2021-04-21 22:03:05 +02:00
Fabien Castan
b2bb1e12c2 [ui] reconstruction: minor rename
_setSelectedViewpoint does not emit a signal, so it should be a private
function.
2021-04-21 22:00:49 +02:00
ludchieng
b1e42e0f39 Add ColorCheckerDetection pipeline 2021-04-21 19:00:22 +02:00
Fabien Castan
0ddda9f982 [multiview] new experimental pipeline for camera tracking 2021-04-16 10:45:57 +02:00
Fabien Castan
d9018ffce6 [ui] PanoramaInit: set init mode to File on xml file drop 2021-01-22 15:21:22 +01:00
Fabien Castan
37d3008f9e [core] rename nodesOfType 2021-01-22 13:12:29 +01:00
Fabien Castan
1102ce84e0 Merge branch 'develop' of github.com:alicevision/meshroom into dev/nodesAndTaskManager
Conflicts:
	meshroom/core/graph.py
	meshroom/ui/qml/main.qml
2020-12-01 20:02:43 +01:00
ChemicalXandco
68b9057619 fix error on live reconstruction 2020-11-11 16:58:11 +00:00
Fabien Castan
589856ecdc Rename hdri into panoramaHdr 2020-09-05 01:16:51 +02:00
Julien-Haudegond
b567d8ff5c [core] Graph: change default reverse direction in dfsOnDiscover() 2020-09-04 12:42:05 +02:00
Julien-Haudegond
208749d897 [core] Graph: change signature of dfsOnDiscover() 2020-09-04 12:22:20 +02:00
Julien-Haudegond
f8bd40ad38 [core] Graph: rename nodesFromNode() to dfsOnDiscover() 2020-09-04 11:49:45 +02:00
Julien-Haudegond
e0389ad957 [ui] move UndoStack and TaskManager instantiations into app.py 2020-08-31 17:43:17 +02:00