Skip to content
This repository has been archived by the owner on Jan 20, 2024. It is now read-only.

Commit

Permalink
[update] change affine API
Browse files Browse the repository at this point in the history
  • Loading branch information
JasperG1998 committed Jul 25, 2022
1 parent 74f7bbb commit f21191f
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions ext_modules/_maix_nn_mud/example/LPR.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,20 +60,18 @@ def process(self,input):
boxes , landmarks = self.loc_decoder.run(loc_out, nms = 0.2 ,score_thresh = 0.7 , outputs_shape =[[1,4,2058],[1,2,2058],[1,8,2058]])

for i,box in enumerate(boxes):
reg_in_crop = input.crop(box[0], box[1] , box[2] - box[0] , box[3] - box[1])
reg_in_resize = reg_in_crop.resize( w =94 ,h=24 ,padding =0)
reg_out = self.reg_model.forward(reg_in_resize , quantize=1, layout = "chw")



landmark = landmarks[i][:6]
reg_in = input.affine(landmark , 94 , 24)
reg_out = self.reg_model.forward(reg_in , quantize=1, layout = "chw")

LP_number = self.reg_decoder.run(reg_out)
string_LP = ''
for id in LP_number:
string_LP += self.chars[id]

self.draw_string(input , box[0], box[1] , string_LP ,color=(225,0,0))
self.draw_paste(input , reg_in_resize)
self.draw_paste(input , reg_in)
self.draw_rectangle(input,box)
self.draw_point(input , landmarks[i])

Expand Down

0 comments on commit f21191f

Please sign in to comment.