Add Search Function: Frontend adds a search box, allowing users to search for matching images.
Bug Fixes: usePhotoStore adds searchPhotos method to handle search requests. NavBar adds a search box, users can input search keywords, and trigger search requests after clicking the search button.
Frontend Optimization:
- The search box only displays an icon by default, and the input box is displayed only after the user clicks it.
- After searching, jump to a separate search result page to display matching images.
- The search result page is similar to
src/views/album/locationpage, displaying matching images, with the title being the search keyword. - Searching may be slow, so a loading animation is needed.
- Search results may be numerous, pay attention to pagination display.
- The search result page is similar to
- Backend interface adapts to frontend needs.
Bug Fixes:
- Unable to jump to the search result page after clicking search.
Bug Fixes: UnifiedPhotoPage.vue displays by timeline, but search results are actually sorted by similarity, which is not suitable for displaying timeline data. Therefore, do not use UnifiedPhotoPage component, use a simple image display component instead.
Optimization:
- The image display component of the search result page adds a click event, clicking displays the detail page of the image (
PhotoLightbox.vue). - Backend API supports setting search threshold, default value is 0.5, searching for images with similarity greater than or equal to the threshold (
search_by_text).
Add Smart Classification Function:
- Backend API supports querying image tags, returning the image tag list and the cover of each tag (similar to
location.py). - Backend supports querying image lists by tag.
- Frontend adds smart classification to display classification results, users can click on classification to view corresponding images (similar to
src/views/album/location).
Optimize AI Service: The text encoding embed of the image classification module uses sentence-transformers/clip-ViT-B-32-multilingual-v1 model, and image encoding still uses the original model.
AI Service Optimization:
- Automatically detect if the model exists when starting, if not, automatically download it.
- Default to use modelscope to download models, placed in
data/models/directory. - Face recognition and image classification models are loaded from
data/models/directory. - Pay attention to adapting to the model directory structure of modelscope.
Bug Fixes: config_manager of task_worker.py and config_manager of the main process are two independent objects, causing the configuration of task_worker.py not to update after the main process modifies the configuration, thus causing task execution failure.
Optimize Model Download Method:
- Set a separate model existence detection and model download function for each service (similar to existing model loading and releasing), so as to customize the download process of different models.
- Clean up the corresponding folder if model download fails or is interrupted to prevent recognition errors.
- Download uses multi-threading method, each model uses a separate download thread to avoid blocking, and the main thread does not need to wait for model download to provide API services externally.
- If the model does not exist or has not finished downloading, return a specific response code indicating that the model is not yet ready.
Frontend Optimization:
- Move the theme switching function of
Navbar.vueto Settings (Settings.vue).
Optimize AI Service:
Put all model names used by AI models into global variables for easy subsequent maintenance and management.
Set a configuration file, including AI model names, parameters (if any), thresholds (if any), etc., for easy subsequent modification and adjustment.
The configuration file provides options for model names, for example, the OCR model has [server, mobile] two versions, giving the currently used model name and options.
Add an interface, users can select different AI model versions on the frontend (can only select from options provided in the configuration file), for example, the [server, mobile] two versions of the OCR model. Save the model version selected by the user to the configuration file. Determine whether the model version selected by the user exists, and if not, download the model.
Optimize Task Management Module:
- Add a running time for each task type. When tasks of this type have not run for a period of time, release the resources corresponding to the task (currently, all resources are released when no tasks are running).
- Add failure task retry function, allowing users to manually trigger retry of failed tasks.
Frontend Optimization:
- Cancel the "New Task" button.
- The task list adds "Retry Failed" and "Force Redo All" buttons.
- Clicking on the number of failed tasks can view the list of failed tasks, displaying detailed failure information.
Frontend:
- Retry failed tasks and force redo all are for a single task type, not for all tasks. Add retry and redo all buttons in the operation menu of each task.
- When the number of failures is 0, do not display view details.
View failure details by filtering task types, instead of directly getting all failed tasks and then filtering on the frontend.
Memory Management Optimization:
- Restart the service if there is no request for a period of time.
Report Frontend and Backend Data Docking:
- Organize and merge data defined in
annualReport.tsto adapt to fields required by frontend pages. - Backend returns data in the format defined by
annualReport.tsbased on existing data.- For data that cannot be obtained at this stage, use default example data instead, to be implemented later.
Requirements
- Do not modify the content displayed on the frontend page, prioritize backend adaptation to frontend.
- Mark clearly the data content that cannot meet the requirements at this stage, and write down todo items.
Optimize Annual Report SectionLocation.vue:
- Map is displayed by city, city points with image data are lit up, other cities remain in default state.
- Hovering over a city can view the image data of that city.
- Mark the city with the most photos.
Modify server-side API to be consistent with frontend requirements (backend should return the number of photos for each city).
Optimize Face Recognition Module:
- Change
face_featurefield offacestable to postgresql vector type, used to store face feature vectors. - Optimize
process_single_photofunction offace.pymodule. Is it necessary to cluster every face? Consider whether batch clustering can improve efficiency. Combine clustering algorithm ofFaceClusterServiceand consider if there is a more efficient clustering method using pgvector index.