You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 line
750B

  1. import multiprocessing
  2. from multiprocessing import Process, Lock, Queue
  3. import time
  4. import sys; print('Python %s on %s' % (sys.version, sys.platform))
  5. sys.path.extend([r'D:\tuoheng\codenew\update\tuoheng_alg\test\demo\demo6.py'])
  6. # Detweights = "/home/th/tuo_heng/dev/AIlib2/weights/river2/yolov5_2080Ti_fp16.engine"
  7. # with open(Detweights, "rb") as f:
  8. # model = f.read()
  9. # Segweights = "/home/th/tuo_heng/dev/AIlib2/weights/river2/stdc_360X640_2080Ti_fp16.engine"
  10. # with open(Segweights, "rb") as f:
  11. # segmodel = f.read()
  12. def add_one(aaa):
  13. aaa.put("111111111")
  14. aaa.cancel_join_thread()
  15. if __name__ == '__main__':
  16. aa = Queue()
  17. p1 = Process(target=add_one, args=(aa,))
  18. p1.start()
  19. time.sleep(2)
  20. print(aa.get())