123456789101112131415161718192021222324252627282930 |
- # -*- coding: utf-8 -*-
- # @Time : 2022/2/28 15:06
- # @Author : MaochengHu
- # @Email : wojiaohumaocheng@gmail.com
- # @File : yolo_test_handler.py
- # @Project : server_develop
- import sys
- import os
- print(os.getcwd())
- sys.path.append("../../src")
- from server_utils.image_convert import path2base64
- from object_detector_handler import ObjectDetectionHandler
- def main():
- test_source = "../test_images/test1.jpg"
- base64str = path2base64(test_source)
- context = None
- output_methods = ["pd_xywh_json", "pd_xywhn", "pd_xyxy", "pd_xyxyn", "tolist", "crop_np", "crop_base64",
- "detail_time_info", "render_base64"]
- obh = ObjectDetectionHandler()
- data = {"data": base64str, "output_methods": str(output_methods).encode(), "base64_bool": str(True).encode()}
- result = obh.handle([data], context)
- print(result)
- if __name__ == "__main__":
- main()
|