Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
qim3d
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
QIM
Tools
qim3d
Commits
2806c0b9
Commit
2806c0b9
authored
Apr 12, 2024
by
Christian Kento Rasmussen
Browse files
Options
Downloads
Patches
Plain Diff
Fix drawing issue in gr.ImageEditor
parent
f4715d16
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!73
Fix drawing issue in gr.ImageEditor
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
qim3d/gui/annotation_tool.py
+9
-5
9 additions, 5 deletions
qim3d/gui/annotation_tool.py
with
9 additions
and
5 deletions
qim3d/gui/annotation_tool.py
+
9
−
5
View file @
2806c0b9
...
@@ -15,13 +15,16 @@ app.launch()
...
@@ -15,13 +15,16 @@ app.launch()
```
```
"""
"""
import
tifffile
import
getpass
import
tempfile
import
os
import
os
import
tempfile
import
time
import
time
import
getpass
import
numpy
as
np
import
gradio
as
gr
import
gradio
as
gr
import
numpy
as
np
import
tifffile
from
PIL
import
Image
import
qim3d.utils
import
qim3d.utils
from
qim3d.io
import
load
,
save
from
qim3d.io
import
load
,
save
from
qim3d.io.logger
import
log
from
qim3d.io.logger
import
log
...
@@ -112,7 +115,8 @@ class Interface:
...
@@ -112,7 +115,8 @@ class Interface:
with
gr
.
Column
(
scale
=
6
):
with
gr
.
Column
(
scale
=
6
):
img_editor
=
gr
.
ImageEditor
(
img_editor
=
gr
.
ImageEditor
(
value
=
img
,
# ! Temporary fix for drawing at wrong location https://github.com/gradio-app/gradio/pull/7959
value
=
{
"
background
"
:
img
,
"
layers
"
:
[
Image
.
new
(
"
RGBA
"
,
img
.
shape
,
(
0
,
0
,
0
,
0
))],
"
composite
"
:
None
}
if
img
is
not
None
else
None
,
type
=
"
numpy
"
,
type
=
"
numpy
"
,
image_mode
=
"
RGB
"
,
image_mode
=
"
RGB
"
,
brush
=
brush
,
brush
=
brush
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment