1
0
mirror of https://gitee.com/sui-feng-cb/AzurLaneAutoScript1 synced 2026-03-19 01:23:34 +08:00

Pref: Reuse image array to improve memory performance

This commit is contained in:
LmeSzinc
2024-06-05 00:20:31 +08:00
parent 77d48937fc
commit 58202c6a40
34 changed files with 61 additions and 58 deletions

View File

@@ -115,7 +115,7 @@ class CampaignOcr(ModuleBase):
@cached_property
def _stage_image(self):
return crop(self.device.image, self._stage_detect_area)
return crop(self.device.image, self._stage_detect_area, copy=False)
@cached_property
def _stage_image_gray(self):
@@ -270,6 +270,8 @@ class CampaignOcr(ModuleBase):
del_cached_property(self, '_stage_image')
del_cached_property(self, '_stage_image_gray')
buttons = self.campaign_extract_name_image(image)
del_cached_property(self, '_stage_image')
del_cached_property(self, '_stage_image_gray')
if len(buttons) == 0:
logger.info('No stage found.')
raise CampaignNameError