From b8b42d420b1b08936bc41ae3497ae23e270c5167 Mon Sep 17 00:00:00 2001 From: "lilong.129" Date: Thu, 14 Nov 2024 22:14:56 +0800 Subject: [PATCH] change: remove image result to reduce summary size --- hrp/internal/version/VERSION | 2 +- hrp/pkg/uixt/action.go | 4 ++-- hrp/pkg/uixt/screenshot.go | 17 +++++++---------- 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/hrp/internal/version/VERSION b/hrp/internal/version/VERSION index 50551ff8..af968133 100644 --- a/hrp/internal/version/VERSION +++ b/hrp/internal/version/VERSION @@ -1 +1 @@ -v5.0.0+2411142130 +v5.0.0+2411142214 diff --git a/hrp/pkg/uixt/action.go b/hrp/pkg/uixt/action.go index 10d1fcd2..9ca1dd3a 100644 --- a/hrp/pkg/uixt/action.go +++ b/hrp/pkg/uixt/action.go @@ -784,8 +784,8 @@ func (dExt *DriverExt) DoAction(action MobileAction) (err error) { type SleepConfig struct { StartTime time.Time `json:"start_time"` - Seconds float64 `json:"seconds"` - Milliseconds int64 `json:"milliseconds"` + Seconds float64 `json:"seconds,omitempty"` + Milliseconds int64 `json:"milliseconds,omitempty"` } var errActionNotImplemented = errors.New("UI action not implemented") diff --git a/hrp/pkg/uixt/screenshot.go b/hrp/pkg/uixt/screenshot.go index 88ded541..02e1809b 100644 --- a/hrp/pkg/uixt/screenshot.go +++ b/hrp/pkg/uixt/screenshot.go @@ -21,15 +21,13 @@ import ( type ScreenResult struct { bufSource *bytes.Buffer // raw image buffer bytes - ImagePath string // image file path - ImageResult *ImageResult // image result - - Resolution Size `json:"resolution"` - UploadedURL string `json:"uploaded_url"` // uploaded image url - Texts OCRTexts `json:"texts"` // dumped raw OCRTexts - Icons UIResultMap `json:"icons"` // CV 识别的图标 - Tags []string `json:"tags"` // tags for image, e.g. ["feed", "ad", "live"] - Popup *PopupInfo `json:"popup,omitempty"` + ImagePath string `json:"image_path"` // image file path + Resolution Size `json:"resolution"` + UploadedURL string `json:"uploaded_url"` // uploaded image url + Texts OCRTexts `json:"texts"` // dumped raw OCRTexts + Icons UIResultMap `json:"icons"` // CV 识别的图标 + Tags []string `json:"tags"` // tags for image, e.g. ["feed", "ad", "live"] + Popup *PopupInfo `json:"popup,omitempty"` } // GetScreenResult takes a screenshot, returns the image recognition result @@ -114,7 +112,6 @@ func (dExt *DriverExt) GetScreenResult(options ...ActionOption) (screenResult *S } } } - screenResult.ImageResult = imageResult } log.Debug().