Skip to content

Commit e18aaf9

Browse files
authored
Merge pull request #185 from yashYRS/python3
Fixed minor changes, that resulted in code crash during runtime
2 parents aacc9fd + 57242d7 commit e18aaf9

File tree

4 files changed

+2
-8
lines changed

4 files changed

+2
-8
lines changed

invert_font_size.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121

2222
FS = FontState()
2323
#plt.figure()
24-
#plt.hold(True)
2524
for i in xrange(len(FS.fonts)):
2625
print i
2726
font = freetype.Font(FS.fonts[i], size=12)

poisson_reconstruct.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,6 @@ def contiguous_regions(mask):
212212
with sns.axes_style("darkgrid"):
213213
plt.subplot(2,1,2)
214214
plt.plot(l_alpha,label='alpha')
215-
plt.hold(True)
216215
plt.plot(l_poisson,label='poisson')
217216
plt.plot(l_actual,label='actual')
218217
plt.legend()
@@ -227,7 +226,6 @@ def contiguous_regions(mask):
227226
with sns.axes_style("white"):
228227
plt.subplot(2,1,1)
229228
plt.imshow(im_alpha[:,:,::-1].astype('uint8'))
230-
plt.hold(True)
231229
plt.plot([0,im_alpha_L.shape[0]-1],[i,i],'r')
232230
plt.axis('image')
233231
plt.show()

synthgen.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -216,9 +216,9 @@ def get_text_placement_mask(xyz,mask,plane,pad=2,viz=False):
216216
REGION : DICT output of TextRegions.get_regions
217217
PAD : number of pixels to pad the placement-mask by
218218
"""
219-
_,contour,hier = cv2.findContours(mask.copy().astype('uint8'),
219+
contour,hier = cv2.findContours(mask.copy().astype('uint8'),
220220
mode=cv2.RETR_CCOMP,
221-
method=cv2.CHAIN_APPROX_SIMPLE)
221+
method=cv2.CHAIN_APPROX_SIMPLE)[-2:]
222222
contour = [np.squeeze(c).astype('float') for c in contour]
223223
#plane = np.array([plane[1],plane[0],plane[2],plane[3]])
224224
H,W = mask.shape[:2]
@@ -280,7 +280,6 @@ def get_text_placement_mask(xyz,mask,plane,pad=2,viz=False):
280280
plt.imshow(mask)
281281
plt.subplot(1,2,2)
282282
plt.imshow(~place_mask)
283-
plt.hold(True)
284283
for i in range(len(pts_fp_i32)):
285284
plt.scatter(pts_fp_i32[i][:,0],pts_fp_i32[i][:,1],
286285
edgecolors='none',facecolor='g',alpha=0.5)
@@ -350,7 +349,6 @@ def viz_textbb(fignum,text_im, bb_list,alpha=1.0):
350349
plt.close(fignum)
351350
plt.figure(fignum)
352351
plt.imshow(text_im)
353-
plt.hold(True)
354352
H,W = text_im.shape[:2]
355353
for i in range(len(bb_list)):
356354
bbs = bb_list[i]

visualize_results.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ def viz_textbb(text_im, charBB_list, wordBB, alpha=1.0):
2424
plt.close(1)
2525
plt.figure(1)
2626
plt.imshow(text_im)
27-
plt.hold(True)
2827
H,W = text_im.shape[:2]
2928

3029
# plot the character-BB:

0 commit comments

Comments
 (0)