Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/talmolab/sleap into liez…
Browse files Browse the repository at this point in the history
…l/bump-to-1.4.1
  • Loading branch information
roomrys committed Dec 18, 2024
2 parents 8a991f0 + 47a0efa commit 084f22b
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 15 deletions.
2 changes: 1 addition & 1 deletion docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ SLEAP can be installed three different ways: via {ref}`conda package<condapackag
````{tabs}
```{group-tab} NVIDIA GPU
```bash
conda create --name sleap pip python=3.7.12 cudatoolkit=11.3 cudnn=8.2
conda create --name sleap pip python=3.7.12 cudatoolkit=11.3 cudnn=8.2 -c conda-forge -c nvidia
```
```
```{group-tab} CPU or other GPU
Expand Down
2 changes: 1 addition & 1 deletion sleap/gui/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -1340,7 +1340,7 @@ def updateStatusMessage(self, message: Optional[str] = None):
message += f" [Hidden] Press '{hide_key}' to toggle."
self.statusBar().setStyleSheet("color: red")
else:
self.statusBar().setStyleSheet("color: black")
self.statusBar().setStyleSheet("")

self.statusBar().showMessage(message)

Expand Down
38 changes: 25 additions & 13 deletions sleap/gui/dataviews.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,17 @@
"""

from qtpy import QtCore, QtWidgets, QtGui

import numpy as np
import os

from operator import itemgetter
from pathlib import Path
from typing import Any, Callable, List, Optional

from typing import Any, Callable, Dict, List, Optional, Type
import numpy as np
from qtpy import QtCore, QtGui, QtWidgets

from sleap.gui.state import GuiState
from sleap.gui.commands import CommandContext
from sleap.gui.color import ColorManager
from sleap.io.dataset import Labels
from sleap.instance import LabeledFrame, Instance
from sleap.gui.state import GuiState
from sleap.instance import LabeledFrame
from sleap.skeleton import Skeleton


Expand Down Expand Up @@ -386,10 +383,25 @@ def getSelectedRowItem(self) -> Any:


class VideosTableModel(GenericTableModel):
properties = ("filename", "frames", "height", "width", "channels")

def item_to_data(self, obj, item):
return {key: getattr(item, key) for key in self.properties}
properties = (
"name",
"filepath",
"frames",
"height",
"width",
"channels",
)

def item_to_data(self, obj, item: "Video"):
data = {}
for property in self.properties:
if property == "name":
data[property] = Path(item.filename).name
elif property == "filepath":
data[property] = str(Path(item.filename).parent)
else:
data[property] = getattr(item, property)
return data


class SkeletonNodesTableModel(GenericTableModel):
Expand Down

0 comments on commit 084f22b

Please sign in to comment.