Skip to content

Commit

Permalink
0.4.3 (#36)
Browse files Browse the repository at this point in the history
* Fix ONNX model conversion

* Fix Text Append node description

* Add tooltip with full path on hover for file inputs
Bump version
  • Loading branch information
joeyballentine committed Mar 27, 2022
1 parent 4c38144 commit e40fd72
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 24 deletions.
6 changes: 5 additions & 1 deletion backend/nodes/pytorch_nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,13 +397,17 @@ def __init__(self):
self.sub = "Utility"

def run(self, model: torch.nn.Module, directory: str, model_name: str) -> None:
model.eval().cuda()
model = model.eval()
if os.environ["device"] == "cuda":
model = model.cuda()
# https://github.com/onnx/onnx/issues/654
dynamic_axes = {
"data": {0: "batch_size", 2: "width", 3: "height"},
"output": {0: "batch_size", 2: "width", 3: "height"},
}
dummy_input = torch.rand(1, model.in_nc, 64, 64).cuda()
if os.environ["device"] == "cuda":
dummy_input = dummy_input.cuda()

torch.onnx.export(
model,
Expand Down
2 changes: 1 addition & 1 deletion backend/nodes/utility_nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class TextAppendNode(NodeBase):
def __init__(self):
"""Constructor"""
super().__init__()
self.description = "Perform mathematical operations on numbers."
self.description = "Append different text together using a separator string."
self.inputs = [
TextInput("Separator", has_handle=False, max_length=3),
TextInput("Text A"),
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "chainner",
"productName": "chaiNNer",
"version": "0.4.2",
"version": "0.4.3",
"description": "A flowchart based image processing GUI",
"main": ".webpack/main",
"scripts": {
Expand Down
49 changes: 30 additions & 19 deletions src/components/inputs/FileInput.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable import/extensions */
/* eslint-disable react/prop-types */
import {
Box, Input, InputGroup, InputLeftElement, VStack,
Box, Input, InputGroup, InputLeftElement, Tooltip, VStack,
} from '@chakra-ui/react';
import { ipcRenderer } from 'electron';
import path from 'path';
Expand Down Expand Up @@ -42,24 +42,35 @@ const FileInput = memo(({

return (
<VStack>
<InputGroup>
<InputLeftElement
pointerEvents="none"
>
<BsFileEarmarkPlus />
</InputLeftElement>
<Input
placeholder="Select a file..."
value={filePath ? path.parse(filePath).base : ''}
isReadOnly
onClick={onButtonClick}
isTruncated
draggable={false}
cursor="pointer"
className="nodrag"
disabled={isLocked}
/>
</InputGroup>
<Tooltip
label={filePath}
borderRadius={8}
py={1}
px={2}
maxW="auto"
>
<InputGroup>
<InputLeftElement
pointerEvents="none"
>
<BsFileEarmarkPlus />
</InputLeftElement>

<Input
placeholder="Select a file..."
value={filePath ? path.parse(filePath).base : ''}
isReadOnly
onClick={onButtonClick}
isTruncated
draggable={false}
cursor="pointer"
className="nodrag"
disabled={isLocked}
alt={filePath}
/>

</InputGroup>
</Tooltip>
{filePath && (
<Box>
{ preview() }
Expand Down

0 comments on commit e40fd72

Please sign in to comment.