Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
AVVR-Pipeline-GDP4
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GDP Project 4
AVVR-Pipeline-GDP4
Merge requests
!11
modified run_shifter to be thread safe and fixed the steps when image is shifted
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
modified run_shifter to be thread safe and fixed the steps when image is shifted
fixing-shifter-checkbox-crash
into
master
Overview
0
Commits
1
Changes
2
Merged
mhby1g21
requested to merge
fixing-shifter-checkbox-crash
into
master
5 months ago
Overview
0
Commits
1
Changes
2
Expand
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
58784ae2
1 commit,
5 months ago
2 files
+
66
−
17
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
scripts/debug_tool/tabs/shifter_tab.py
+
27
−
7
Options
@@ -104,18 +104,38 @@ class ShifterTab(QWidget):
scrollbar
.
setValue
(
scrollbar
.
maximum
())
def
run_shifter
(
self
):
"""
GUI version of shifter - calls the thread-safe version
"""
if
not
self
.
input_file_path
:
QMessageBox
.
warning
(
self
,
"
Warning
"
,
"
Please select an input file first
"
)
return
return
False
self
.
update_status
(
"
\n
Running image shifter...
"
)
success
,
_
=
run_command
(
self
,
self
.
cmd_text
.
toPlainText
(),
self
.
update_status
)
success
,
_
=
self
.
run_shifter_process
(
self
.
update_status
)
if
success
and
os
.
path
.
exists
(
self
.
shifted_image_path
):
self
.
update_status
(
f
"
Shifted image saved to:
{
self
.
shifted_image_path
}
"
)
update_preview
(
self
.
output_preview
,
self
.
shifted_image_path
,
error_callback
=
self
.
update_status
)
\ No newline at end of file
error_callback
=
self
.
update_status
)
return
success
def
run_shifter_process
(
self
,
status_callback
=
None
):
"""
Thread-safe version of shifter that doesn
'
t use GUI components
"""
try
:
if
not
self
.
input_file_path
:
raise
ValueError
(
"
No input file selected
"
)
# Construct command without using GUI components
conda_dir
=
self
.
config_reader
.
config
[
"
condaDir
"
]
material_env
=
self
.
config_reader
.
config
[
"
materialEnv
"
]
shifter_script
=
os
.
path
.
join
(
self
.
config_reader
.
directories
[
'
scriptDir
'
],
"
shifter.py
"
)
command
=
f
'"
{
conda_dir
}
\\
condabin
\\
activate.bat
"
{
material_env
}
&&
'
\
f
'
python
"
{
shifter_script
}
"
"
{
self
.
input_file_path
}
"
"
{
self
.
shifted_image_path
}
"'
# Run the command
return
run_command
(
None
,
command
,
status_callback
)
except
Exception
as
e
:
if
status_callback
:
status_callback
(
f
"
Error in shifter process:
{
str
(
e
)
}
"
)
return
False
,
str
(
e
)
\ No newline at end of file
Loading