Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ui] Add filters to image gallery #1500

Merged
merged 39 commits into from
Sep 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
f532ad7
[ui] Add filters to Image Gallery
N0Ls Jun 16, 2021
817c5dd
[ui] Add number of intrinsics to display
N0Ls Jun 16, 2021
32c6d89
[ui] Add some padding
N0Ls Jun 16, 2021
70c9f8b
[wip] Add display of intrinsics
N0Ls Jun 20, 2021
53b371d
[wip] Display as list view
N0Ls Jun 24, 2021
83c9600
[wip] Add intrinsic display inside image gallery
N0Ls Jun 25, 2021
fef5002
[ui] Update enabled and visible states for intrinsics display
N0Ls Jun 28, 2021
469f91c
[ui] Fix scroll bar conflict
N0Ls Jun 28, 2021
a3c395f
[ui] Avoid undefined warning for intrinsic count
N0Ls Jun 29, 2021
212d817
[wip] Add function to build an object from intrinsics
N0Ls Jun 30, 2021
88cd6fb
[wip] Add table view to display intrinsics infos
N0Ls Jul 1, 2021
0deb9b4
[wip] Update intrinsic parsing
N0Ls Jul 2, 2021
379be4a
[ui] Update intrinsic parsing and displayed values
N0Ls Jul 6, 2021
b0ee91d
[ui] Remove old display method files
N0Ls Jul 6, 2021
c1939e4
[ui] Add horizontal scrollbar to scroll across all intrinsics attributes
N0Ls Jul 6, 2021
683633f
[ui] Update intrinsic display
N0Ls Jul 6, 2021
4cabfb7
[ui] Add dynamic view update on intrinsic changed
N0Ls Jul 6, 2021
776cbe7
[ui] Add combo box and check box for specific intrinsics
N0Ls Jul 8, 2021
713b2f2
[ui] Add the possibility to dynamically change attribute values
N0Ls Jul 8, 2021
7a8f78f
[ui] Fix combo box height and placeholder display status
N0Ls Jul 8, 2021
2eb8783
[ui] Change Intrinsic display QML structure
N0Ls Aug 2, 2021
79955dd
[core] Change attribute name and label properties
N0Ls Aug 3, 2021
b0254de
[ui] UI adjustements for intrinsic display
N0Ls Aug 5, 2021
7c0a966
[ui] Clean code
N0Ls Aug 5, 2021
6f5b659
[ui] Adjust column width for serial number
N0Ls Aug 9, 2021
6bb5f84
[ui] Clean forgotten debug
N0Ls Aug 9, 2021
eecdcff
[ui] Enable focus change when clicking outside of text inputs
N0Ls Aug 9, 2021
0876b9e
[ui] Add vertical scrollbar for high number of intrinsics
N0Ls Aug 9, 2021
4fb719e
[ui] Update tableview to stop flicking at bounds
N0Ls Aug 9, 2021
83a404a
[ui] Add clipping to columns
N0Ls Aug 17, 2021
56d91bd
[ui] Change intrinsic structure and key getter for table view
N0Ls Aug 22, 2021
ee910b9
[ui] Change buttons default display before reconstruction
N0Ls Aug 23, 2021
500dfd9
[ui] Change from i++ to ++i
N0Ls Aug 27, 2021
c0737bb
[doc] readme: add citation
fabiencastan Aug 30, 2021
73da16d
Merge pull request #1520 from alicevision/doc-citation
simogasp Aug 30, 2021
b1c421b
[doc] how to use Meshroom without building AliceVision (#1487)
remmel Aug 30, 2021
af4dae9
Merge branch 'dev/ImageGalleryFilter' of https://github.com/N0Ls/mesh…
fabiencastan Sep 1, 2021
d3559bd
[ui] fix image selection in ImageGallery
fabiencastan Sep 1, 2021
da1f239
[ui] ImageGallery: fix sort and filtering
fabiencastan Sep 1, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 33 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,25 @@ Presentation of the Meshroom software with a focus on using it for Match Moving.
The project is released under MPLv2, see [**COPYING.md**](COPYING.md).


## Citation

If you use this project for research, please cite:
```
@inproceedings{alicevision2021,
title={{A}liceVision {M}eshroom: An open-source {3D} reconstruction pipeline},
authors={Carsten Griwodz, Simone Gasparini, Lilian Calvet, Pierre Gurdjos, Fabien Castan, Benoit Maujean, Gregoire De Lillo, Yann Lanthony},
booktitle={Proc. 12th ACM Multimed. Syst. Conf. - MMSys '21},
doi = {10.1145/3458305.3478443}
publisher = {ACM Press},
year = {2021}
}
```

## Get the project

See [**INSTALL.md**](INSTALL.md) to setup the project and pre-requisites.
You can [download pre-compiled binaries for the latest release](https://github.com/alicevision/meshroom/releases).

If you want to build it yourself, see [**INSTALL.md**](INSTALL.md) to setup the project and pre-requisites.

Get the source code and install runtime requirements:
```bash
Expand Down Expand Up @@ -93,6 +109,22 @@ You may need to adjust the folder `/usr/lib/nvidia-340` with the correct driver
python bin/meshroom_batch --input INPUT_IMAGES_FOLDER --output OUTPUT_FOLDER
```

## Start Meshroom without building AliceVision

To use Meshroom (ui) without building AliceVision
* Download a [release](https://github.com/alicevision/meshroom/releases)
* Checkout corresponding Meshroom (ui) version/tag to avoid versions incompatibilities
* `LD_LIBRARY_PATH=~/foo/Meshroom-2021.1.0/aliceVision/lib/ PATH=$PATH:~/foo/Meshroom-2021.1.0/aliceVision/bin/ PYTHONPATH=$PWD python3 meshroom/ui`

## Start and Debug Meshroom in an IDE

PyCharm Community is free IDE which can be used. To start and debug a project with that IDE,
right-click on `Meshroom/ui/__main__.py` > `Debug`, then `Edit Configuration`, in `Environment variables` :
* If you want to use aliceVision built by yourself add: `PATH=$PATH:/foo/build/Linux-x86_64/`
* If you want to use aliceVision release add: `LD_LIBRARY_PATH=/foo/Meshroom-2021.1.0/aliceVision/lib/;PATH=$PATH:/foo/Meshroom-2021.1.0/aliceVision/bin/` (Make sure that you are on the branch matching the right version)

![image](https://user-images.githubusercontent.com/937836/127321375-3bf78e73-569d-414a-8649-de0307adf794.png)


## FAQ

Expand Down
46 changes: 36 additions & 10 deletions meshroom/core/attribute.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,24 +71,29 @@ def node(self):
def root(self):
return self._root() if self._root else None

def absoluteName(self):
return '{}.{}.{}'.format(self.node.graph.name, self.node.name, self._name)
def getName(self):
""" Attribute name """
return self._name

def getFullName(self):
""" Name inside the Graph: nodeName.name """
""" Name inside the Graph: groupName.name """
if isinstance(self.root, ListAttribute):
return '{}[{}]'.format(self.root.getFullName(), self.root.index(self))
elif isinstance(self.root, GroupAttribute):
return '{}.{}'.format(self.root.getFullName(), self._name)
return '{}.{}'.format(self.node.name, self._name)
return '{}.{}'.format(self.root.getFullName(), self.getName())
return self.getName()

def getFullNameToNode(self):
""" Name inside the Graph: nodeName.groupName.name """
return '{}.{}'.format(self.node.name, self.getFullName())

def getFullNameToGraph(self):
""" Name inside the Graph: graphName.nodeName.groupName.name """
return '{}.{}'.format(self.node.graph.name, self.getFullNameToNode())

def asLinkExpr(self):
""" Return link expression for this Attribute """
return "{" + self.getFullName() + "}"

def getName(self):
""" Attribute name """
return self._name
return "{" + self.getFullNameToNode() + "}"

def getType(self):
return self.attributeDesc.__class__.__name__
Expand All @@ -102,6 +107,22 @@ def getBaseType(self):
def getLabel(self):
return self._label

def getFullLabel(self):
""" Full Label includes the name of all parent groups, e.g. 'groupLabel subGroupLabel Label' """
if isinstance(self.root, ListAttribute):
return self.root.getFullLabel()
elif isinstance(self.root, GroupAttribute):
return '{} {}'.format(self.root.getFullLabel(), self.getLabel())
return self.getLabel()

def getFullLabelToNode(self):
""" Label inside the Graph: nodeLabel groupLabel Label """
return '{} {}'.format(self.node.label, self.getFullLabel())

def getFullLabelToGraph(self):
""" Label inside the Graph: graphName nodeLabel groupLabel Label """
return '{} {}'.format(self.node.graph.name, self.getFullLabelToNode())

def getEnabled(self):
if isinstance(self.desc.enabled, types.FunctionType):
try:
Expand Down Expand Up @@ -265,7 +286,12 @@ def updateInternals(self):

name = Property(str, getName, constant=True)
fullName = Property(str, getFullName, constant=True)
fullNameToNode = Property(str, getFullNameToNode, constant=True)
fullNameToGraph = Property(str, getFullNameToGraph, constant=True)
label = Property(str, getLabel, constant=True)
fullLabel = Property(str, getFullLabel, constant=True)
fullLabelToNode = Property(str, getFullLabelToNode, constant=True)
fullLabelToGraph = Property(str, getFullLabelToGraph, constant=True)
type = Property(str, getType, constant=True)
baseType = Property(str, getType, constant=True)
isReadOnly = Property(bool, _isReadOnly, constant=True)
Expand Down
11 changes: 5 additions & 6 deletions meshroom/core/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ def nodeOutEdges(self, node):
def removeNode(self, nodeName):
"""
Remove the node identified by 'nodeName' from the graph
and return in and out edges removed by this operation in two dicts {dstAttr.getFullName(), srcAttr.getFullName()}
and return in and out edges removed by this operation in two dicts {dstAttr.getFullNameToNode(), srcAttr.getFullNameToNode()}
"""
node = self.node(nodeName)
inEdges = {}
Expand All @@ -425,10 +425,10 @@ def removeNode(self, nodeName):
with GraphModification(self):
for edge in self.nodeOutEdges(node):
self.removeEdge(edge.dst)
outEdges[edge.dst.getFullName()] = edge.src.getFullName()
outEdges[edge.dst.getFullNameToNode()] = edge.src.getFullNameToNode()
for edge in self.nodeInEdges(node):
self.removeEdge(edge.dst)
inEdges[edge.dst.getFullName()] = edge.src.getFullName()
inEdges[edge.dst.getFullNameToNode()] = edge.src.getFullNameToNode()

node.alive = False
self._nodes.remove(node)
Expand Down Expand Up @@ -583,7 +583,7 @@ def addEdge(self, srcAttr, dstAttr):
if srcAttr.node.graph != self or dstAttr.node.graph != self:
raise RuntimeError('The attributes of the edge should be part of a common graph.')
if dstAttr in self.edges.keys():
raise RuntimeError('Destination attribute "{}" is already connected.'.format(dstAttr.getFullName()))
raise RuntimeError('Destination attribute "{}" is already connected.'.format(dstAttr.getFullNameToNode()))
edge = Edge(srcAttr, dstAttr)
self.edges.add(edge)
self.markNodesDirty(dstAttr.node)
Expand All @@ -600,7 +600,7 @@ def addEdges(self, *edges):
@changeTopology
def removeEdge(self, dstAttr):
if dstAttr not in self.edges.keys():
raise RuntimeError('Attribute "{}" is not connected'.format(dstAttr.getFullName()))
raise RuntimeError('Attribute "{}" is not connected'.format(dstAttr.getFullNameToNode()))
edge = self.edges.pop(dstAttr)
self.markNodesDirty(dstAttr.node)
dstAttr.valueChanged.emit()
Expand Down Expand Up @@ -1202,4 +1202,3 @@ def loadGraph(filepath):
graph.load(filepath)
graph.update()
return graph

18 changes: 9 additions & 9 deletions meshroom/ui/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,10 @@ def undoImpl(self):
class SetAttributeCommand(GraphCommand):
def __init__(self, graph, attribute, value, parent=None):
super(SetAttributeCommand, self).__init__(graph, parent)
self.attrName = attribute.getFullName()
self.attrName = attribute.getFullNameToNode()
self.value = value
self.oldValue = attribute.getExportValue()
self.setText("Set Attribute '{}'".format(attribute.getFullName()))
self.setText("Set Attribute '{}'".format(attribute.getFullNameToNode()))

def redoImpl(self):
if self.value == self.oldValue:
Expand All @@ -215,8 +215,8 @@ def undoImpl(self):
class AddEdgeCommand(GraphCommand):
def __init__(self, graph, src, dst, parent=None):
super(AddEdgeCommand, self).__init__(graph, parent)
self.srcAttr = src.getFullName()
self.dstAttr = dst.getFullName()
self.srcAttr = src.getFullNameToNode()
self.dstAttr = dst.getFullNameToNode()
self.setText("Connect '{}'->'{}'".format(self.srcAttr, self.dstAttr))

if src.baseType != dst.baseType:
Expand All @@ -233,8 +233,8 @@ def undoImpl(self):
class RemoveEdgeCommand(GraphCommand):
def __init__(self, graph, edge, parent=None):
super(RemoveEdgeCommand, self).__init__(graph, parent)
self.srcAttr = edge.src.getFullName()
self.dstAttr = edge.dst.getFullName()
self.srcAttr = edge.src.getFullNameToNode()
self.dstAttr = edge.dst.getFullNameToNode()
self.setText("Disconnect '{}'->'{}'".format(self.srcAttr, self.dstAttr))

def redoImpl(self):
Expand All @@ -250,7 +250,7 @@ class ListAttributeAppendCommand(GraphCommand):
def __init__(self, graph, listAttribute, value, parent=None):
super(ListAttributeAppendCommand, self).__init__(graph, parent)
assert isinstance(listAttribute, ListAttribute)
self.attrName = listAttribute.getFullName()
self.attrName = listAttribute.getFullNameToNode()
self.index = None
self.count = 1
self.value = value if value else None
Expand All @@ -276,10 +276,10 @@ def __init__(self, graph, attribute, parent=None):
super(ListAttributeRemoveCommand, self).__init__(graph, parent)
listAttribute = attribute.root
assert isinstance(listAttribute, ListAttribute)
self.listAttrName = listAttribute.getFullName()
self.listAttrName = listAttribute.getFullNameToNode()
self.index = listAttribute.index(attribute)
self.value = attribute.getExportValue()
self.setText("Remove {}".format(attribute.getFullName()))
self.setText("Remove {}".format(attribute.getFullNameToNode()))

def redoImpl(self):
listAttribute = self.graph.attribute(self.listAttrName)
Expand Down
6 changes: 3 additions & 3 deletions meshroom/ui/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -618,22 +618,22 @@ def clearDataFrom(self, nodes):
@Slot(Attribute, Attribute)
def addEdge(self, src, dst):
if isinstance(dst, ListAttribute) and not isinstance(src, ListAttribute):
with self.groupedGraphModification("Insert and Add Edge on {}".format(dst.getFullName())):
with self.groupedGraphModification("Insert and Add Edge on {}".format(dst.getFullNameToNode())):
self.appendAttribute(dst)
self._addEdge(src, dst.at(-1))
else:
self._addEdge(src, dst)

def _addEdge(self, src, dst):
with self.groupedGraphModification("Connect '{}'->'{}'".format(src.getFullName(), dst.getFullName())):
with self.groupedGraphModification("Connect '{}'->'{}'".format(src.getFullNameToNode(), dst.getFullNameToNode())):
if dst in self._graph.edges.keys():
self.removeEdge(self._graph.edge(dst))
self.push(commands.AddEdgeCommand(self._graph, src, dst))

@Slot(Edge)
def removeEdge(self, edge):
if isinstance(edge.dst.root, ListAttribute):
with self.groupedGraphModification("Remove Edge and Delete {}".format(edge.dst.getFullName())):
with self.groupedGraphModification("Remove Edge and Delete {}".format(edge.dst.getFullNameToNode())):
self.push(commands.RemoveEdgeCommand(self._graph, edge))
self.removeAttribute(edge.dst)
else:
Expand Down
Loading