Closed shiquanwang closed 8 years ago
Thanks you are right, this should work.
For now, you can then add more than one image at a time via the command line to your label file:
sloth appendfiles [options] <labelfile> <file1> [<file2> ...]
for example:
sloth appendfiles mylabels.json *.jpg
OK. Thanks.
Was this ever fixed?
.jpg doesnt work for me. Looking at the code, I dont see how this could work. I'm assuming .jpg wasnt met to be literal.
@isaacgerg *.jpg
relies on shell globbing (to actually extend the regex into all matching file names). So yeah, as far as sloth is concerned, *.jpg
is not meant literally.
@shiquanwang There are some patches/commits coming up that will allow to add multiple images at once, stay tuned.
I've made quite a few changes to sloth but have them locally. I didnt know anyone was working on sloth or I wouldve actively contributed them.
On Fri, Jul 29, 2016 at 8:43 PM, nilsonholger notifications@github.com wrote:
@isaacgerg https://github.com/isaacgerg .jpg relies on shell globbing (to actually extend the regex into all matching file names). So yeah, as far as sloth is concerned, .jpg is not meant literally.
@shiquanwang https://github.com/shiquanwang There are some patches/commits coming up that will allow to add multiple images at once, stay tuned.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/cvhciKIT/sloth/issues/90#issuecomment-236326907, or mute the thread https://github.com/notifications/unsubscribe-auth/ALarq2Lff2FEWTBlU9EoZEU7yOVvqeN8ks5qap44gaJpZM4C21Xg .
@isaacgerg Well, I would be really grateful if you took the effort to submit your local changes and possible fixes as pull requests, I promise I will look into them in a timely manner. We are definitely still working with sloth, we've just reached the point where it is mostly doing exactly what we need it to do, so it might seem a bit abandoned from the outside.
I am looking at my changes to sloth I made locally. They are UI enhancements. I am not sure how to do a PR in github. Also, some of the changes are hacks I put in for my data and I don't want to share them.
Below is a summary of my changes:
@@ -408,7 +408,8 @@
def data(self, role=Qt.DisplayRole, column=0):
if role == Qt.DisplayRole:
if column == 0:
- return os.path.basename(self['filename'])
+ return self['filename'][-60:]
+ #return os.path.basename(self['filename'])
elif column == 1 and self.isUnlabeled():
return '[unlabeled]'
return ModelItem.data(self, role, column)
@@ -141,12 +141,15 @@
inserter.inserterFinished.connect(self.onInserterFinished)
self._labeltool.currentImageChanged.connect(inserter.imageChange)
self._inserter = inserter
+
+ # Change cursor to cross
+ self.views()[0].viewport().setCursor(Qt.CrossCursor)
LOG.debug("Created inserter for class '%s' with default properties '%s'" % (label_class, default_properties))
def onInsertionModeEnded(self):
if self._inserter is not None:
self._inserter.abort()
-
+ self.views()[0].viewport().setCursor(Qt.ArrowCursor)
#
# common methods
#______________________________________________________________________________________________________
@@ -26,6 +26,11 @@
self._pan = False
self._panStartX = -1
self._panStartY = -1
+
+ # Windows photo viewer like controls
+ self.setRenderHints(QPainter.Antialiasing|QPainter.SmoothPixmapTransform)
+ self.setTransformationAnchor(QGraphicsView.AnchorUnderMouse)
+ self.setDragMode(QGraphicsView.ScrollHandDrag)
def fitInView(self):
if self.scene() is None:
@@ -142,7 +142,7 @@
if isinstance(new_image, FrameModelItem):
self.controls.setFrameNumAndTimestamp(new_image.framenum(), new_image.timestamp())
elif isinstance(new_image, ImageFileModelItem):
- self.controls.setFilename(os.path.basename(new_image['filename']))
+ self.controls.setFilename(new_image['filename'])
self.selectionmodel.setCurrentIndex(new_image.index(), QItemSelectionModel.ClearAndSelect|QItemSelectionModel.Rows)
@@ -118,7 +118,7 @@
self.annotationFinished.emit()
self._init_pos = None
self._item = None
-
+ self._scene.views()[0].viewport().setCursor(Qt.CrossCursor)
event.accept()
def allowOutOfSceneEvents(self):
That's it for now. Will continue to post my fixes.
@isaacgerg to do a Pull Request, you have to fork the sloth repository, clone your fork to your workstation, modify and commit and then you can submit a pull request. Maybe there is an easier way these days through the GitHub webinterface though.
Anyway, thank you for these patches, I will look into them and apply them as I see fit. Also, when I do that now, they will not have your name attached to the commits, but I will try to remember to reference your username in the commit message.
@isaacgerg Created commit e8f7284 from your changes, but did not include the elided text. Thank you for your patches.
As far as this issue goes, it should be fixed with commit 2b49500. Closing this issue now.
Click the button
Add Image
, only can add a single image once.Shift
andCtl
for multi selection not working.