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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user