Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix results method in writer #1077

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions alphapose/utils/writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def start(self):
return self

def update(self):
final_result = []
self.final_result = []
norm_type = self.cfg.LOSS.get('NORM_TYPE', None)
hm_size = self.cfg.DATA_PRESET.HEATMAP_SIZE
if self.save_video:
Expand All @@ -100,7 +100,7 @@ def update(self):
# if the thread indicator variable is set (img is None), stop the thread
if self.save_video:
stream.release()
write_json(final_result, self.opt.outputpath, form=self.opt.format, for_eval=self.opt.eval)
write_json(self.final_result, self.opt.outputpath, form=self.opt.format, for_eval=self.opt.eval)
print("Results have been written to json.")
return
# image channel RGB->BGR
Expand Down Expand Up @@ -168,7 +168,7 @@ def update(self):
for i in range(len(poseflow_result)):
result['result'][i]['idx'] = poseflow_result[i]['idx']

final_result.append(result)
self.final_result.append(result)
if self.opt.save_img or self.save_video or self.opt.vis:
if hm_data.size()[1] == 49:
from alphapose.utils.vis import vis_frame_dense as vis_frame
Expand Down Expand Up @@ -224,7 +224,7 @@ def clear(self, queue):

def results(self):
# return final result
print(self.final_result)
# print(self.final_result)
return self.final_result

def recognize_video_ext(self, ext=''):
Expand Down