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
Commits
b8a68835
Commit
b8a68835
authored
6 months ago
by
mhby1g21
Browse files
Options
Downloads
Patches
Plain Diff
commenting out interactable pic section that cause gui freeze
parent
c67fc9cf
Branches
Branches containing commit
No related tags found
1 merge request
!10
fixed gui freezes
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/simple_tab.py
+69
-69
69 additions, 69 deletions
scripts/simple_tab.py
with
69 additions
and
69 deletions
scripts/simple_tab.py
+
69
−
69
View file @
b8a68835
...
@@ -342,66 +342,66 @@ class SimpleTab(QWidget):
...
@@ -342,66 +342,66 @@ class SimpleTab(QWidget):
layout
.
addWidget
(
controls_group
)
layout
.
addWidget
(
controls_group
)
# Image Distance section
#
#
Image Distance section
self
.
image_distance_group
=
QGroupBox
(
"
Image Distance
"
)
#
self.image_distance_group = QGroupBox("Image Distance")
distance_layout
=
QVBoxLayout
(
self
.
image_distance_group
)
#
distance_layout = QVBoxLayout(self.image_distance_group)
info_label
=
QLabel
(
"
Please select two point on the image and input the distance from the camera to that point.
"
)
#
info_label = QLabel("Please select two point on the image and input the distance from the camera to that point.")
self
.
counter_label
=
QLabel
(
"
(0/2)
"
)
#
self.counter_label = QLabel("(0/2)")
self
.
distance_preview
=
ClickableLabel
()
#
self.distance_preview = ClickableLabel()
self
.
distance_preview
.
setAlignment
(
Qt
.
AlignmentFlag
.
AlignCenter
)
#
self.distance_preview.setAlignment(Qt.AlignmentFlag.AlignCenter)
self
.
counter_label
.
setAlignment
(
Qt
.
AlignmentFlag
.
AlignBottom
|
Qt
.
AlignmentFlag
.
AlignCenter
)
#
self.counter_label.setAlignment(Qt.AlignmentFlag.AlignBottom | Qt.AlignmentFlag.AlignCenter)
self
.
points_info_label
=
QLabel
()
# Label to display points and distances
#
self.points_info_label = QLabel() # Label to display points and distances
self
.
points_info_label
.
setAlignment
(
Qt
.
AlignmentFlag
.
AlignTop
|
Qt
.
AlignmentFlag
.
AlignCenter
)
#
self.points_info_label.setAlignment(Qt.AlignmentFlag.AlignTop | Qt.AlignmentFlag.AlignCenter)
self
.
image_distance_group
.
setStyleSheet
(
"""
#
self.image_distance_group.setStyleSheet("""
QGroupBox {
#
QGroupBox {
font-weight: bold;
#
font-weight: bold;
border: 2px solid grey;
#
border: 2px solid grey;
border-radius: 20px;
#
border-radius: 20px;
margin-top: 10px;
#
margin-top: 10px;
background-color: #3e3e3e;
#
background-color: #3e3e3e;
padding: 20px;
#
padding: 20px;
}
#
}
QGroupBox::title {
#
QGroupBox::title {
margin: 10px;
#
margin: 10px;
background-color: transparent;
#
background-color: transparent;
color: white;
#
color: white;
}
#
}
QLabel {
#
QLabel {
margin: 5px;
#
margin: 5px;
background-color: #3e3e3e;
#
background-color: #3e3e3e;
color: white;
#
color: white;
}
#
}
"""
)
#
""")
# Center the ClickableLabel within its parent layout
#
#
Center the ClickableLabel within its parent layout
distance_preview_layout
=
QHBoxLayout
()
#
distance_preview_layout = QHBoxLayout()
distance_preview_layout
.
addStretch
()
#
distance_preview_layout.addStretch()
distance_preview_layout
.
addWidget
(
self
.
distance_preview
)
#
distance_preview_layout.addWidget(self.distance_preview)
distance_preview_layout
.
addStretch
()
#
distance_preview_layout.addStretch()
#
self
.
distance_reset_btn
=
QPushButton
(
"
Reset Points
"
)
#
self.distance_reset_btn = QPushButton("Reset Points")
self
.
distance_reset_btn
.
clicked
.
connect
(
self
.
distance_preview
.
clear_points
)
#
self.distance_reset_btn.clicked.connect(self.distance_preview.clear_points)
self
.
distance_reset_btn
.
setFixedSize
(
150
,
40
)
#
self.distance_reset_btn.setFixedSize(150, 40)
self
.
distance_reset_btn
.
setStyleSheet
(
"""
#
self.distance_reset_btn.setStyleSheet("""
QPushButton {
#
QPushButton {
margin: 5px;
#
margin: 5px;
padding: 5px;
#
padding: 5px;
border-radius: 10px;
#
border-radius: 10px;
}
#
}
"""
)
#
""")
distance_btn_layout
=
QHBoxLayout
()
#
distance_btn_layout = QHBoxLayout()
distance_btn_layout
.
addStretch
()
#
distance_btn_layout.addStretch()
distance_btn_layout
.
addWidget
(
self
.
distance_reset_btn
)
#
distance_btn_layout.addWidget(self.distance_reset_btn)
distance_btn_layout
.
addStretch
()
#
distance_btn_layout.addStretch()
#
distance_layout
.
addWidget
(
info_label
)
#
distance_layout.addWidget(info_label)
distance_layout
.
addLayout
(
distance_preview_layout
)
#
distance_layout.addLayout(distance_preview_layout)
distance_layout
.
addWidget
(
self
.
points_info_label
)
#
distance_layout.addWidget(self.points_info_label)
distance_layout
.
addWidget
(
self
.
counter_label
)
#
distance_layout.addWidget(self.counter_label)
distance_layout
.
addWidget
(
self
.
distance_reset_btn
)
#
distance_layout.addWidget(self.distance_reset_btn)
self
.
image_distance_group
.
hide
()
#
self.image_distance_group.hide()
layout
.
addWidget
(
self
.
image_distance_group
)
#
layout.addWidget(self.image_distance_group)
#
self
.
distance_preview
.
point_added
.
connect
(
self
.
update_counter_Label
)
#
self.distance_preview.point_added.connect(self.update_counter_Label)
# Status section
# Status section
status_group
,
self
.
status_text
=
create_group_with_text
(
"
Pipeline Status
"
,
300
)
status_group
,
self
.
status_text
=
create_group_with_text
(
"
Pipeline Status
"
,
300
)
...
@@ -518,15 +518,15 @@ class SimpleTab(QWidget):
...
@@ -518,15 +518,15 @@ class SimpleTab(QWidget):
self
.
update_status
(
f
"
Selected input file:
{
file_path
}
"
)
self
.
update_status
(
f
"
Selected input file:
{
file_path
}
"
)
update_preview
(
self
.
input_preview
,
file_path
,
update_preview
(
self
.
input_preview
,
file_path
,
error_callback
=
self
.
update_status
)
error_callback
=
self
.
update_status
)
update_preview
(
self
.
distance_preview
,
file_path
,
max_size
=
1500
)
#
update_preview(self.distance_preview,file_path,max_size=1500)
pixmap
=
load_and_resize_image
(
file_path
,
1500
)
#
pixmap = load_and_resize_image(file_path, 1500)
pixmap
=
convert_cv_to_pixmap
(
pixmap
)
#
pixmap = convert_cv_to_pixmap(pixmap)
self
.
distance_preview
.
setFixedSize
(
pixmap
.
size
())
#
self.distance_preview.setFixedSize(pixmap.size())
self
.
image_distance_group
.
show
()
#
self.image_distance_group.show()
self
.
update_status
(
"
Waiting for distance points...
"
)
#
self.update_status("Waiting for distance points...")
self
.
info_labels
[
"
Status:
"
].
setText
(
"
Waiting for distance points...
"
)
#
self.info_labels["Status:"].setText("Waiting for distance points...")
# Enable the run pipeline button
# Enable the run pipeline button
#
self.run_pipeline_btn.setEnabled(True)
self
.
run_pipeline_btn
.
setEnabled
(
True
)
# Provide input path to all modules
# Provide input path to all modules
self
.
shifter
.
input_file_path
=
file_path
self
.
shifter
.
input_file_path
=
file_path
...
@@ -595,7 +595,7 @@ class SimpleTab(QWidget):
...
@@ -595,7 +595,7 @@ class SimpleTab(QWidget):
#TODO: Add distance points to the pipeline for depth estimation
#TODO: Add distance points to the pipeline for depth estimation
# Get the distance points
# Get the distance points
self
.
distance_points
=
self
.
distance_preview
.
get_points
()
#
self.distance_points = self.distance_preview.get_points()
# Start the pipeline
# Start the pipeline
self
.
pipeline_thread
.
start
()
self
.
pipeline_thread
.
start
()
...
...
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