Skip to content

Commit

Permalink
fix cast problems
Browse files Browse the repository at this point in the history
  • Loading branch information
maxcorsini committed Nov 7, 2024
1 parent 101c21b commit 5c0a6e3
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions source/NewDataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -1310,7 +1310,7 @@ def save_samples(self, filename, show_tiles=False, show_areas=True, radii=None):
for sample in self.training_tiles:
cx = sample[0] - HALF_SAMPLE_SIZE
cy = sample[1] - HALF_SAMPLE_SIZE
painter.drawEllipse(cx, cy, SAMPLE_SIZE, SAMPLE_SIZE)
painter.drawEllipse(int(cx), int(cy), int(SAMPLE_SIZE), int(SAMPLE_SIZE))

# brush = QBrush(Qt.NoBrush)
# brush.setColor(Qt.green)
Expand All @@ -1332,7 +1332,7 @@ def save_samples(self, filename, show_tiles=False, show_areas=True, radii=None):
for sample in self.validation_tiles:
cx = sample[0] - HALF_SAMPLE_SIZE
cy = sample[1] - HALF_SAMPLE_SIZE
painter.drawEllipse(cx, cy, SAMPLE_SIZE, SAMPLE_SIZE)
painter.drawEllipse(int(cx), int(cy), int(SAMPLE_SIZE), int(SAMPLE_SIZE))

# TEST
brush = QBrush(Qt.SolidPattern)
Expand All @@ -1341,7 +1341,7 @@ def save_samples(self, filename, show_tiles=False, show_areas=True, radii=None):
for sample in self.test_tiles:
cx = sample[0] - HALF_SAMPLE_SIZE
cy = sample[1] - HALF_SAMPLE_SIZE
painter.drawEllipse(cx, cy, SAMPLE_SIZE, SAMPLE_SIZE)
painter.drawEllipse(int(cx), int(cy), int(SAMPLE_SIZE), int(SAMPLE_SIZE))

if show_tiles is True:

Expand All @@ -1359,7 +1359,7 @@ def save_samples(self, filename, show_tiles=False, show_areas=True, radii=None):
cy = sample[1]
top = cy - half_size
left = cx - half_size
painter.drawRect(left, top, size, size)
painter.drawRect(int(left), int(top), int(size), int(size))

pen = QPen(Qt.blue)
pen.setWidth(PEN_WIDTH)
Expand All @@ -1369,7 +1369,7 @@ def save_samples(self, filename, show_tiles=False, show_areas=True, radii=None):
cy = sample[1]
top = cy - half_size
left = cx - half_size
painter.drawRect(left, top, size, size)
painter.drawRect(int(left), int(top), int(size), int(size))

pen = QPen(Qt.red)
pen.setWidth(PEN_WIDTH)
Expand All @@ -1379,7 +1379,7 @@ def save_samples(self, filename, show_tiles=False, show_areas=True, radii=None):
cy = sample[1]
top = cy - half_size
left = cx - half_size
painter.drawRect(left, top, size, size)
painter.drawRect(int(left), int(top), int(size), int(size))

if show_areas is True:

Expand All @@ -1390,14 +1390,14 @@ def save_samples(self, filename, show_tiles=False, show_areas=True, radii=None):
pen.setWidth(pen_width)
pen.setStyle(Qt.DashDotLine)
painter.setPen(pen)
painter.drawRect(self.val_area[1], self.val_area[0], self.val_area[2], self.val_area[3])
painter.drawRect(int(self.val_area[1]), int(self.val_area[0]), int(self.val_area[2]), int(self.val_area[3]))

painter.setBrush(Qt.NoBrush)
pen = QPen(Qt.red)
pen.setWidth(pen_width)
pen.setStyle(Qt.DashDotLine)
painter.setPen(pen)
painter.drawRect(self.test_area[1], self.test_area[0], self.test_area[2], self.test_area[3])
painter.drawRect(int(self.test_area[1]), int(self.test_area[0]), int(self.test_area[2]), int(self.test_area[3]))

painter.end()

Expand Down

0 comments on commit 5c0a6e3

Please sign in to comment.