Giter VIP home page Giter VIP logo

Comments (12)

StormArcher avatar StormArcher commented on July 28, 2024

$ python run.py
Traceback (most recent call last):
File "run.py", line 79, in
tracker.init([ix, iy, w, h], frame) # TODO tracker.init
File "/home/hp/zjc/nk_PyCharm/PyCharm_project/nk_DeepSortYolo/deep_sort_yolov3-master/3_uoip-KCFpy
/KCFpy/kcftracker.py", line 283, in init
self._tmpl = self.getFeatures(image, 1)
File "/home/hp/zjc/nk_PyCharm/PyCharm_project/nk_DeepSortYolo/deep_sort_yolov3-master/3_uoip-KCFpy
/KCFpy/kcftracker.py", line 194, in getFeatures
cx = self._roi[0] + self._roi[2]/2 # float # TODO 此处报错
TypeError: 'map' object is not subscriptable

from kcfpy.

Dai-z avatar Dai-z commented on July 28, 2024

$ python run.py
Traceback (most recent call last):
File "run.py", line 79, in
tracker.init([ix, iy, w, h], frame) # TODO tracker.init
File "/home/hp/zjc/nk_PyCharm/PyCharm_project/nk_DeepSortYolo/deep_sort_yolov3-master/3_uoip-KCFpy
/KCFpy/kcftracker.py", line 283, in init
self._tmpl = self.getFeatures(image, 1)
File "/home/hp/zjc/nk_PyCharm/PyCharm_project/nk_DeepSortYolo/deep_sort_yolov3-master/3_uoip-KCFpy
/KCFpy/kcftracker.py", line 194, in getFeatures
cx = self._roi[0] + self._roi[2]/2 # float # TODO 此处报错
TypeError: 'map' object is not subscriptable

map() returns a list in python2, but in python3, it returns a map object.
So you can wrap map() with list() e.g.

list(map(float, roi))

And i guess you'll meet other errors with python3 like: '/' may return a int in python2 if two numbers are both int, but always return float in python3.

After solving all these errors with python3, I can run this code, but sometimes I crop a region, it will crash, like this:
image
Do you know anything about this?

from kcfpy.

StormArcher avatar StormArcher commented on July 28, 2024

Thanks i already use list map.your advice is good .i meet many problem .now i can run . I am in china . It is to late .tomorrow i will see the problem you put deeper

from kcfpy.

StormArcher avatar StormArcher commented on July 28, 2024

when you crop a region. It.must be even pixel .if it's odd pixel,will meet this problem. raw an col both need even .i solve the problem by turning odd to even. I hope it can help you .if you have other better method please share it with me

from kcfpy.

Dai-z avatar Dai-z commented on July 28, 2024

Thanks! It won't crash now

from kcfpy.

StormArcher avatar StormArcher commented on July 28, 2024

Do you. Use the method i provide to. Solve your problem ? i think there is other better way to solve it

from kcfpy.

raozhongyu avatar raozhongyu commented on July 28, 2024

你好,我想问一下添加list 之后是否出现
Traceback (most recent call last):
File "/home/rao/KCFpy/run.py", line 75, in
tracker.init([ix,iy,w,h], frame)
File "/home/rao/KCFpy/kcftracker.py", line 271, in init
self._tmpl = self.getFeatures(image, 1)
File "/home/rao/KCFpy/kcftracker.py", line 220, in getFeatures
z = cv2.resize(z, tuple(self._tmpl_sz))
TypeError: integer argument expected, got float
这种问题

from kcfpy.

irisqp avatar irisqp commented on July 28, 2024

ink there is other better way to solve it
你好,我也遇到了这个问题,请问你具体是怎么改的呢?even pixel怎么确定,还有就是,我怎么能暂停视频,画好我要追踪的目标,然后再追踪呢,视频里的目标移动太快了,我来不及画框。

from kcfpy.

irisqp avatar irisqp commented on July 28, 2024

你好,我想问一下添加list 之后是否出现
Traceback (most recent call last):
File "/home/rao/KCFpy/run.py", line 75, in
tracker.init([ix,iy,w,h], frame)
File "/home/rao/KCFpy/kcftracker.py", line 271, in init
self._tmpl = self.getFeatures(image, 1)
File "/home/rao/KCFpy/kcftracker.py", line 220, in getFeatures
z = cv2.resize(z, tuple(self._tmpl_sz))
TypeError: integer argument expected, got float
这种问题

是,我把float转为int后还会报新的错误

from kcfpy.

thenighthunter0 avatar thenighthunter0 commented on July 28, 2024

然后,你们怎么解决的呢

from kcfpy.

HIT-five avatar HIT-five commented on July 28, 2024

然后,你们怎么解决的呢

change all the '/' into '//' in these codes

from kcfpy.

GreenTeaHua avatar GreenTeaHua commented on July 28, 2024

in line #267
self._roi = list(map(float, roi)) # add list by hua

from kcfpy.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.