Giter VIP home page Giter VIP logo

yolo-series's People

Contributors

markjay4k avatar speedcoder5 avatar theredmudder avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

yolo-series's Issues

Where the extension of -fs-?

Hi sorry, which part of the video that you mentioned about the extension of -fs- when training data have done. As mentioned in pt8 (15:03), I mean the code part for generating it.

TypeError: the JSON object must be str, not 'bytes'

While i run this script:

import os
import urllib.request as ulib
from bs4 import BeautifulSoup as Soup
import json

url_a = 'https://www.google.com/search?ei=1m7NWePfFYaGmQG51q7IBg&hl=en&q={}'
url_b = '&tbm=isch&ved=0ahUKEwjjovnD7sjWAhUGQyYKHTmrC2kQuT0I7gEoAQ&start={}'
url_c = '&yv=2&vet=10ahUKEwjjovnD7sjWAhUGQyYKHTmrC2kQuT0I7gEoAQ.1m7NWePfFYaGmQG51q7IBg'
url_d = '.i&ijn=1&asearch=ichunk&async=_id:rg_s,_pms:s'
url_base = ''.join((url_a, url_b, url_c, url_d))

headers = {'User-Agent': 'Chrome/41.0.2228.0 Safari/537.36'}

def get_links(search_name):
search_name = search_name.replace(' ', '+')
url = url_base.format(search_name, 0)
request = ulib.Request(url, None, headers)
json_string = ulib.urlopen(request).read()
page = json.loads(json_string)
new_soup = Soup(page[1][1], 'lxml')
images = new_soup.find_all('img')
links = [image['src'] for image in images]
return links

if name == 'main':
search_name = 'fidget spinner'
links = get_links(search_name)

for link in links:
print (link)

i got this error:

Traceback (most recent call last):
File "C:\Users\lenovo\Desktop\darkflow-master\cam.py", line 29, in
links = get_links(search_name)
File "C:\Users\lenovo\Desktop\darkflow-master\cam.py", line 20, in get_links
page = json.loads(json_string)
File "C:\Users\lenovo\Anaconda31\lib\json_init_.py", line 312, in loads
s.class.name))
TypeError: the JSON object must be str, not 'bytes'
[Finished in 1.669s]
sans titre

help please !

Error loading model

I did exactly what you wrote, and I have issue.

define the model options and run

options = {
'model': 'cfg/yolo.cfg',
'load': 'bin/yolo.weights',
'threshold': 0.3,
'gpu': 1
}

tfnet = TFNet(options)

TypeError: Expected int32, got list containing Tensors of type '_Message' instead.

Program running at 0.3 fps

The entire setup is very very slow, other CNN algorithms are fast enough but this one is very slow, even using the same code as given here. Please help

[Not an actual issue] Regarding YOLOv3

Hey Mark, Nice video you got there. Followed them and now I have a working plug and play object detection system. What I wanted to know about, what should I do if I were to use YOLOv3 or resnet or some other model? Also, it would be nice if you could make a video on image segmentation as well.
Well, thanks for the videos though!
Cheers!

where i should save the .py script?

i try using other python application and i save the .py file in the same directory of darkflow, but the load model is always filed and always get error like this

AssertionError: bin/yolo.weights not found
Traceback (most recent call last):
File "C:\Users\Mladen Stokev\Anaconda3\pkgs\pywin32-222-py36hfa6e2cd_0\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py", line 326, in RunScript
exec(codeObject, main.dict)
File "C:\dark\darkflow\ngetestpy.py", line 6, in
tfnet = TFNet(options)
File "C:\dark\darkflow\darkflow\net\build.py", line 58, in init
darknet = Darknet(FLAGS)
File "C:\dark\darkflow\darkflow\dark\darknet.py", line 13, in init
self.get_weight_src(FLAGS)
File "C:\dark\darkflow\darkflow\dark\darknet.py", line 47, in get_weight_src
'{} not found'.format(FLAGS.load)
AssertionError: bin/yolo.weights not found

where i should place the .py file? please if you have answer thankyou

Multiple objects annotating

Hey, @markjay4k great tutorial, man!
I'm trying to annotate more than 1 object in an image. While doing so, how to save the annotation files for those particular objects. Writing code for it was pretty confusing to me.
Is there any way that you've come across to resolve this issue?
Cheers!!

Using Flow

When trying to use flow to load an mp4 video to process I get the following error:

It looks like it's trying to use a camera and not load the file (just a guess).

image

How to count unique captured object from webcam?

Hi,

I have trained my model for single class, i want to count the object detected in webcam, means it should count unique object, if same object detecting in frame then it should count as one until it leave the frame.
Anyone can tell me please to do so.

Thanks in advance.

ValueError: operands could not be broadcast together with shapes (520,1200,4) (3,)

Hey Mark! Thank you for your tutorials on YOLO! But I am getting this error when I am going to train my own model and the error is:

cfg/tiny-yolo-voc-1c.cfg parsing new_model_dir/annotations
Parsing for ['gun']
[====================>]100% 000188.xml
Statistics:
gun: 235
Dataset size: 158
Dataset of 158 instance(s)
libpng warning: iCCP: known incorrect sRGB profile
Traceback (most recent call last):
File "flow", line 6, in
cliHandler(sys.argv)
File "/content/drive/My Drive/WHAT THE/darkflow/darkflow/cli.py", line 33, in cliHandler
print('Enter training ...'); tfnet.train()
File "/content/drive/My Drive/WHAT THE/darkflow/darkflow/net/flow.py", line 39, in train
for i, (x_batch, datum) in enumerate(batches):
File "/content/drive/My Drive/WHAT THE/darkflow/darkflow/net/yolo/data.py", line 114, in shuffle
inp, new_feed = self._batch(train_instance)
File "/content/drive/My Drive/WHAT THE/darkflow/darkflow/net/yolov2/data.py", line 27, in _batch
img = self.preprocess(path, allobj)
File "/content/drive/My Drive/WHAT THE/darkflow/darkflow/net/yolo/predict.py", line 71, in preprocess
im = imcv2_recolor(im)
File "/content/drive/My Drive/WHAT THE/darkflow/darkflow/utils/im_transform.py", line 11, in imcv2_recolor
im = im * (1 + t * a)
ValueError: operands could not be broadcast together with shapes (520,1200,4) (3,)

Any idea how to get rid of it please?

What should be possible loss to train YOLO model?

Hey guys i am tarining a model on my custom dataset,
Can you tell me please What should be possible loss to train YOLO model, below is the training console:

step 343 - loss 17.77151107788086 - moving ave loss 18.94973713932652
step 344 - loss 17.025156021118164 - moving ave loss 18.757279027505685
step 345 - loss 17.319908142089844 - moving ave loss 18.6135419389641
step 346 - loss 17.478084564208984 - moving ave loss 18.49999620148859
step 347 - loss 17.533782958984375 - moving ave loss 18.403374877238168

At what loss i should stop the training?

HTTPError: HTTP Error 400: Bad Request

import os
import urllib.request as ulib
from bs4 import BeautifulSoup as Soup
import json

url_a = 'https://www.google.com/search?ei=1m7NWePfFYaGmQG51q7IBg&hl=en&q={}'
url_b = '&tbm=isch&ved=0ahUKEwjjovnD7sjWAhUGQyYKHTmrC2kQuT0I7gEoAQ&start={}'
url_c = '&yv=2&vet=10ahUKEwjjovnD7sjWAhUGQyYKHTmrC2kQuT0I7gEoAQ.1m7NWePfFYaGmQG51q7IBg'
url_d = '.i&ijn=1&asearch=ichunk&async=_id:rg_s,_pms:s'
url_base = ''.join((url_a, url_b, url_c, url_d))

headers = {'User-Agent': 'Chrome/41.0.2228.0 Safari/537.36'}

def get_links(search_name):
search_name = search_name.replace(' ', '+')
url = url_base.format(search_name, 0)
request = ulib.Request(url, None, headers)
json_string = ulib.urlopen(request).read()
page = json.loads(json_string.decode("utf-8"))
new_soup = Soup(page[1][1], 'lxml')
images = new_soup.find_all('img')
links = [image['src'] for image in images]
return links

def save_images(links, search_name):
directory = search_name.replace(' ', '_')
if not os.path.isdir(directory):
os.mkdir(directory)

for i, link in enumerate(links):
    savepath = os.path.join(directory, '{:06}.png'.format(i))
    ulib.urlretrieve(link, savepath)

if name == 'main':
search_name = 'fidget kid spinner toys'
links = get_links(search_name)
save_images(links, search_name)

error after running the above code:


HTTPError Traceback (most recent call last)
in
37 if name == 'main':
38 search_name = 'fidget kid spinner toys'
---> 39 links = get_links(search_name)
40 save_images(links, search_name)

in get_links(search_name)
17 url = url_base.format(search_name, 0)
18 request = ulib.Request(url, None, headers)
---> 19 json_string = ulib.urlopen(request).read()
20 page = json.loads(json_string.decode("utf-8"))
21 new_soup = Soup(page[1][1], 'lxml')

C:\ProgramData\Anaconda3\lib\urllib\request.py in urlopen(url, data, timeout, cafile, capath, cadefault, context)
220 else:
221 opener = _opener
--> 222 return opener.open(url, data, timeout)
223
224 def install_opener(opener):

C:\ProgramData\Anaconda3\lib\urllib\request.py in open(self, fullurl, data, timeout)
529 for processor in self.process_response.get(protocol, []):
530 meth = getattr(processor, meth_name)
--> 531 response = meth(req, response)
532
533 return response

C:\ProgramData\Anaconda3\lib\urllib\request.py in http_response(self, request, response)
639 if not (200 <= code < 300):
640 response = self.parent.error(
--> 641 'http', request, response, code, msg, hdrs)
642
643 return response

C:\ProgramData\Anaconda3\lib\urllib\request.py in error(self, proto, *args)
567 if http_err:
568 args = (dict, 'default', 'http_error_default') + orig_args
--> 569 return self._call_chain(*args)
570
571 # XXX probably also want an abstract factory that knows when it makes

C:\ProgramData\Anaconda3\lib\urllib\request.py in _call_chain(self, chain, kind, meth_name, *args)
501 for handler in handlers:
502 func = getattr(handler, meth_name)
--> 503 result = func(*args)
504 if result is not None:
505 return result

C:\ProgramData\Anaconda3\lib\urllib\request.py in http_error_default(self, req, fp, code, msg, hdrs)
647 class HTTPDefaultErrorHandler(BaseHandler):
648 def http_error_default(self, req, fp, code, msg, hdrs):
--> 649 raise HTTPError(req.full_url, code, msg, hdrs, fp)
650
651 class HTTPRedirectHandler(BaseHandler):

please help

import error .pyx files

getting the below error while importing the darkflow.net.build import TFNet

ModuleNotFoundError Traceback (most recent call last)
in
1 import cv2
----> 2 from darkflow.net.build import TFNet
3 import matplotlib.pyplot as plt
4
5 get_ipython().run_line_magic('config', "InlineBackend.figure_format = 'svg'")

~/darkflow/darkflow/net/build.py in
5 from .ops import op_create, identity
6 from .ops import HEADER, LINE
----> 7 from .framework import create_framework
8 from ..dark.darknet import Darknet
9 import json

~/darkflow/darkflow/net/framework.py in
----> 1 from . import yolo
2 from . import yolov2
3 from . import vanilla
4 from os.path import basename
5

~/darkflow/darkflow/net/yolo/init.py in
1 from . import train
----> 2 from . import predict
3 from . import data
4 from . import misc
5 import numpy as np

~/darkflow/darkflow/net/yolo/predict.py in
5 import os
6 import json
----> 7 from ...cython_utils.cy_yolo_findboxes import yolo_box_constructor
8
9 def _fix(obj, dims, scale, offs):

ModuleNotFoundError: No module named 'darkflow.cython_utils.cy_yolo_findboxes'

ValueError: numpy.ufunc size changed, may indicate binary incompatibility. Expected 216 from C header, got 192 from PyObject

I use this command to processing my video

python flow --model cfg/yolo.cfg --load bin/yolov2.weights --demo fri1hd.mp4 --saveVideo

but i get this error

Traceback (most recent call last): File "flow", line 4, in <module> from darkflow.cli import cliHandler File "/home/bhavesh/Object Detection/customyolo/darkflow/darkflow/cli.py", line 3, in <module> from .net.build import TFNet File "/home/bhavesh/Object Detection/customyolo/darkflow/darkflow/net/build.py", line 7, in <module> from .framework import create_framework File "/home/bhavesh/Object Detection/customyolo/darkflow/darkflow/net/framework.py", line 1, in <module> from . import yolo File "/home/bhavesh/Object Detection/customyolo/darkflow/darkflow/net/yolo/__init__.py", line 2, in <module> from . import predict File "/home/bhavesh/Object Detection/customyolo/darkflow/darkflow/net/yolo/predict.py", line 7, in <module> from ...cython_utils.cy_yolo_findboxes import yolo_box_constructor File "__init__.pxd", line 918, in init darkflow.cython_utils.cy_yolo_findboxes ValueError: numpy.ufunc size changed, may indicate binary incompatibility. Expected 216 from C header, got 192 from PyObject

someone help me to solve this error.

Thank you.

Error while running rename code

[WinError 183] Cannot create a file when that file already exists: 'new_model_data\data_12_stop ahead sign' -> 'images\0000000.png'

can anyone please help me

part 6 (AttributeError: 'FigureManagerBase' object has no attribute 'window') no rectangular was drawn

i get this problem
`AttributeError Traceback (most recent call last)
in
16 fig, ax = plt.subplots(1)
17 mngr = plt.get_current_fig_manager()
---> 18 mngr.window.setGeometry(250, 120, 1280, 1024)
19 image = cv2.imread(image_file.path)
20 image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)

AttributeError: 'FigureManagerBase' object has no attribute 'window'`
on this line of code

mngr.window.setGeometry(250, 120, 1280, 1024)

why i get this error ?

i run the code in jupyter in i get this
Screenshot 2019-06-15 02 32 25

when i click on the photo no rectangular is appear

any help ?

Annotate for different objects

Hi mark. I am not able to annotate for different objects. can you please help me? Here's the code.
`import os
import matplotlib.pyplot as plt
import cv2
from matplotlib.widgets import RectangleSelector
from generate_xml import write_xml

global constants

img = None
tl_list = []
br_list = []
object_list = []

constants

image_folder = 'images'
savedir = 'annotations'
obj = 'Blight'
obj2 = 'Downy Mildew'
obj3 = 'Leaf Spot'
obj4 = 'Webworm'
obj5 = 'Aphids'
obj6 = 'Leafminers'
obj7 = 'Healthy'

def line_select_callback(clk, rls):
global tl_list
global br_list
global object_list
tl_list.append((int(clk.xdata), int(clk.ydata)))
br_list.append((int(rls.xdata), int(rls.ydata)))
object_list.append(obj)
object_list.append(obj2)
object_list.append(obj3)
object_list.append(obj4)
object_list.append(obj5)
object_list.append(obj6)
object_list.append(obj7)

def onkeypress(event):
global object_list
global tl_list
global br_list
global img
if event.key == 'q':
print (object_list.append(obj2))
write_xml(image_folder, img, object_list, tl_list, br_list, savedir)
tl_list = []
br_list = []
object_list = []
img = None
elif event.key == 'd':
print(object_list.append(obj3))
write_xml(image_folder, img, object_list, tl_list, br_list, savedir)
tl_list = []
br_list = []
object_list = []
img = None

def toggle_selector(event):
toggle_selector.RS.set_active(True)

if name == 'main':
for n, image_file in enumerate(os.scandir(image_folder)):
img = image_file
fig, ax = plt.subplots(1, figsize=(10.5, 8))
mngr = plt.get_current_fig_manager()
mngr.window.setGeometry(250, 40, 800, 600)
image = cv2.imread(image_file.path)
image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
ax.imshow(image)

    toggle_selector.RS = RectangleSelector(
        ax, line_select_callback,
        drawtype='box', useblit=True,
        button=[1], minspanx=5, minspany=5,
        spancoords='pixels', interactive=True,
    )
    bbox = plt.connect('key_press_event', toggle_selector)
    key = plt.connect('key_press_event', onkeypress)
    plt.tight_layout()
    plt.show()
    plt.close(fig)

`
whenever i run the code. i get an error like this

None Traceback (most recent call last): File "C:\Users\User\Anaconda3\lib\site-packages\matplotlib\cbook\__init__.py", line 388, in process proxy(*args, **kwargs) File "C:\Users\User\Anaconda3\lib\site-packages\matplotlib\cbook\__init__.py", line 228, in __call__ return mtd(*args, **kwargs) File "part6.py", line 53, in onkeypress write_xml(image_folder, img, object_list, tl_list, br_list, savedir) File "C:\Users\User\Desktop\Disease-detection\generate_xml.py", line 11, in write_xml image = cv2.imread(img.path) AttributeError: 'NoneType' object has no attribute 'path'

Training custom Data

darkflow-master\darkflow\utils\pascal_voc_clean_xml

This file raises the bad character range i-a at position "xxx" error. I am attaching the gist file (Log of error output) here.

I tested the work-around given here and it works. (change to pascal_voc_clean_xml) as follows
annotations = glob.glob(str(annotations)+'*.xml') to annotations = glob.glob('*.xml')

I would like to know if this is a recommended fix and can be updated in the repository.

Generate XML code is not saving XML file

first of all thanks a lot for making really amazing tutorials and helping people to learn new things.

I am using the exact same code copied from your github to generate annotations, when i run the code the following 2 things happens:

1: it opens all the images all at once.
2: it saves .jpeg file not XML file.

when i double click the .jpeg file in the annotations folder it not showing anything.
so how can i correct this?
thanks,

No module named darkflow

I followed up the exact same things as it was there in the part 1. I don't know how to solve this issue. Kindly help me out.

_tkinter_tkapp has no attribute setGeometry

Stacktrace is as follows:
Traceback (most recent call last): File "C:\Users\Paperspace\Downloads\darkflow-master\new_model_data\draw_box.py", line 52, in <module> mngr.window.setGeometry(250, 120, 1280, 1024) File "C:\Program Files (x86)\Python36-32\lib\tkinter\__init__.py", line 2095, in __getattr__ return getattr(self.tk, attr) AttributeError: '_tkinter.tkapp' object has no attribute 'setGeometry'

What could be causing this?

Change of number of categories

First of all, thank you very much for your code. It is very clear and very useful.

I was able to run it perfectly, and works fine, but for the kind of classification I intend to do, it would be better to use the 9000+ categories of Yolo 9000 instead of the 80 object categories of the COCO dataset. However, I tried changing the .cfg file and it seems it is not so easy, at least for me. Could you help me to change it with some advices?

HTTP Error 400: Bad Request in Part 5 Get Images

"/home/bhavesh/Object Detection/env/bin/python" "/home/bhavesh/Object Detection/YOLO-series/part5 - get_images.py" Traceback (most recent call last): File "/home/bhavesh/Object Detection/YOLO-series/part5 - get_images.py", line 41, in <module> links = get_links(search_name) File "/home/bhavesh/Object Detection/YOLO-series/part5 - get_images.py", line 21, in get_links json_string = ulib.urlopen(request).read() File "/usr/lib/python3.6/urllib/request.py", line 223, in urlopen return opener.open(url, data, timeout) File "/usr/lib/python3.6/urllib/request.py", line 532, in open response = meth(req, response) File "/usr/lib/python3.6/urllib/request.py", line 642, in http_response 'http', request, response, code, msg, hdrs) File "/usr/lib/python3.6/urllib/request.py", line 570, in error return self._call_chain(*args) File "/usr/lib/python3.6/urllib/request.py", line 504, in _call_chain result = func(*args) File "/usr/lib/python3.6/urllib/request.py", line 650, in http_error_default raise HTTPError(req.full_url, code, msg, hdrs, fp) urllib.error.HTTPError: HTTP Error 400: Bad Request

OpenCV Error: Assertion failed (scn == 3 || scn == 4) in cvtColor, file

I am struggling with draw_box__py36.py.

I keep getting the following error. Any advice?

OpenCV Error: Assertion failed (scn == 3 || scn == 4) in cvtColor, file ~/modules/imgproc/src/color.cpp, line 11079
Traceback (most recent call last):
File "/Users/student/darknet/part6 - draw_box_py36.py", line 52, in
image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
~/opencv-python/opencv/modules/imgproc/src/color.cpp:11079: error: (-215) scn == 3 || scn == 4 in function cvtColor

[Finished in 6.736s]

error: [WinError 3] The system cannot find the path specified:

Hello, I am very new in coding and I got this issue while building the library:

error: [WinError 3] The system cannot find the path specified: 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\PlatformSDK\lib'

I have no idea why it points this directory. How can I change it?

Thank you in advance for any help.

New Dataset Training Error - "AttributeError: 'NoneType' object has no attribute 'shape'"

Hi, I am trying to train custom object detection to detect my company-logo, everything went well until this error, I also deleted and annotated images again but it no change in the outcome. Can someone please help me with this
Thank You

cfg/tiny-yolo-voc-1c.cfg parsing annotations_clean
Parsing for ['vodafone']
[====================>]100%  Image9.xml
Statistics:
vodafone: 28
Dataset size: 28
Dataset of 28 instance(s)
Image12.jpg
Traceback (most recent call last):
  File "flow", line 6, in <module>
    cliHandler(sys.argv)
  File "C:\Users\karanbari\Desktop\YOLO\darkflow-master\darkflow\cli.py", line 33, in cliHandler
    print('Enter training ...'); tfnet.train()
  File "C:\Users\karanbari\Desktop\YOLO\darkflow-master\darkflow\net\flow.py", line 39, in train
    for i, (x_batch, datum) in enumerate(batches):
  File "C:\Users\karanbari\Desktop\YOLO\darkflow-master\darkflow\net\yolo\data.py", line 114, in shuffle
    inp, new_feed = self._batch(train_instance)
  File "C:\Users\karanbari\Desktop\YOLO\darkflow-master\darkflow\net\yolov2\data.py", line 28, in _batch
    img = self.preprocess(path, allobj)
  File "C:\Users\karanbari\Desktop\YOLO\darkflow-master\darkflow\net\yolo\predict.py", line 62, in preprocess
    result = imcv2_affine_trans(im)
  File "C:\Users\karanbari\Desktop\YOLO\darkflow-master\darkflow\utils\im_transform.py", line 20, in imcv2_affine_trans
    h, w, c = im.shape
AttributeError: 'NoneType' object has no attribute 'shape'

This is the corresponding .xml file:

<annotation>
  <folder>images\train_clean</folder>
  <filename>Image12.jpg</filename>
  <segmented>0</segmented>
  <size>
    <width>446</width>
    <height>113</height>
    <depth>3</depth>
  </size>
  <object>
    <name>vodafone</name>
    <pose>Unspecified</pose>
    <truncated>0</truncated>
    <difficult>0</difficult>
    <bndbox>
      <xmin>0</xmin>
      <ymin>0</ymin>
      <xmax>115</xmax>
      <ymax>111</ymax>
    </bndbox>
  </object>
</annotation>

Cannot find directory coc names

iam using pycharm and when i run this code i get this error
error
FileNotFoundError: [Errno 2] No such file or directory: './cfg/coco.names'
Please help!Thanks in Advance

capture and process the model output label and confidence

How to get the output label and confidence detected to be held in variables so that I can further process them programmatically? Simply overlay label and confidence of object in video is not of great use if I cannot do anything with what detected.

Using check.py (for Video processing)

I keep getting the error that darkflow has not been installed as a module which I get but I can't seem to get it to install. The From Darkflow... this happens on all the .py executables.

#importing dependencies
import cv2
import time
import sys, os
import datetime
import numpy as np
import imutils
from imutils.video import FPS
from darkflow.net.build import TFNet
from imutils.video import WebcamVideoStream

Cant load the model

Sorry everyone, can anyone give me some input about this.
I use window 10 and followed mark jay atom setup. Somehow, I still get this error

Traceback (most recent call last):
File "C:\Users\user\Downloads\darkflow-master (new)\testing.py", line 13, in
tfnet = TFNet(option)
File "C:\Users\user\Downloads\darkflow-master (new)\darkflow\net\build.py", line 58, in init
darknet = Darknet(FLAGS)
File "C:\Users\user\Downloads\darkflow-master (new)\darkflow\dark\darknet.py", line 13, in init
self.get_weight_src(FLAGS)
File "C:\Users\user\Downloads\darkflow-master (new)\darkflow\dark\darknet.py", line 47, in get_weight_src
'{} not found'.format(FLAGS.load)
AssertionError: bin/yolov2.weights not found

I had put the right directory but still get this error. I read a solution which mentioned window permission access. How can I do that? In atom environment or just the file

AttributeError: 'FigureManagerBase' object has no attribute 'window'

I'm facing this issue in the program draw_box.py.
The images are loading one by one in Spyder IDE and even in Jupyter but the code :
bbox=plt.connect('key_press_event', toggle_selector)
key=plt.connect('key_press_event', onkeypress)
is not working properly. A new window is not popping up and no keypress event is being detected. Instead all the images in the directory are being loaded one by one if I comment out the setGeometry line.
What can be done?

No significant reduction in loss.

Last part of my tiny-yolo-voc-1c.cfg file:

[convolutional]
batch_normalize=1
size=3
stride=1
pad=1
filters=125
activation=leaky

[convolutional]
size=1
stride=1
pad=1
filters=30
activation=linear

[region]
anchors = 1.08,1.19,  3.42,4.41,  6.63,11.38,  9.42,5.11,  16.62,10.52
bias_match=1
classes=1
coords=4
num=5
softmax=1
jitter=.2
rescore=1

object_scale=5
noobject_scale=1
class_scale=1
coord_scale=1

absolute=1
thresh = .5
random=1

Even after i trained for 6 hours on gpu the loss seems to reduce very slowly and it was above 90.
Here is a small sample after epoch 3 and epoch 16:

Right now the training goes like this:

Epoch 3:

step 100 - loss 105.87599182128906 - moving ave loss 105.92378855073041 step 101 - loss 105.90802001953125 - moving ave loss 105.92221169761049 step 102 - loss 105.96070861816406 - moving ave loss 105.92606138966585 step 103 - loss 105.91077423095703 - moving ave loss 105.92453267379497 step 104 - loss 105.89263916015625 - moving ave loss 105.9213433224311 step 105 - loss 105.79179382324219 - moving ave loss 105.9083883725122 step 106 - loss 105.97239685058594 - moving ave loss 105.91478922031959 step 107 - loss 105.93550109863281 - moving ave loss 105.91686040815092 step 108 - loss 105.82689666748047 - moving ave loss 105.90786403408389 step 109 - loss 105.89955139160156 - moving ave loss 105.90703276983565 step 110 - loss 105.97517395019531 - moving ave loss 105.91384688787163 step 111 - loss 105.94683074951172 - moving ave loss 105.91714527403565 Finish 3 epoch(es) step 112 - loss 105.88888549804688 - moving ave loss 105.91431929643677 step 113 - loss 105.77619934082031 - moving ave loss 105.90050730087513 step 114 - loss 106.05404663085938 - moving ave loss 105.91586123387356 step 115 - loss 105.96916198730469 - moving ave loss 105.92119130921667 step 116 - loss 105.88710021972656 - moving ave loss 105.91778220026767 step 117 - loss 105.81925201416016 - moving ave loss 105.90792918165691 step 118 - loss 105.8878173828125 - moving ave loss 105.90591800177248 step 119 - loss 105.89876556396484 - moving ave loss 105.90520275799172 step 120 - loss 105.86831665039062 - moving ave loss 105.90151414723161 step 121 - loss 105.82453918457031 - moving ave loss 105.89381665096549 step 122 - loss 105.72496795654297 - moving ave loss 105.87693178152324 step 123 - loss 105.88580322265625 - moving ave loss 105.87781892563655

Epoch 16:

step 592 - loss 104.63841247558594 - moving ave loss 104.63666866604511 Finish 16 epoch(es) step 593 - loss 104.696533203125 - moving ave loss 104.6426551197531 step 594 - loss 104.6519775390625 - moving ave loss 104.64358736168404 step 595 - loss 104.64488220214844 - moving ave loss 104.64371684573048 step 596 - loss 104.63302612304688 - moving ave loss 104.64264777346212 step 597 - loss 104.54460144042969 - moving ave loss 104.63284314015887 step 598 - loss 104.62289428710938 - moving ave loss 104.63184825485394 step 599 - loss 104.47380065917969 - moving ave loss 104.61604349528652 step 600 - loss 104.67867279052734 - moving ave loss 104.6223064248106 step 601 - loss 104.47022247314453 - moving ave loss 104.60709802964399 step 602 - loss 104.56214904785156 - moving ave loss 104.60260313146475 step 603 - loss 104.53447723388672 - moving ave loss 104.59579054170695 step 604 - loss 104.71623229980469 - moving ave loss 104.60783471751672 step 605 - loss 104.48993682861328 - moving ave loss 104.59604492862638 step 606 - loss 104.55252838134766 - moving ave loss 104.59169327389851 step 607 - loss 104.4090576171875 - moving ave loss 104.57342970822742 step 608 - loss 104.76617431640625 - moving ave loss 104.5927041690453 step 609 - loss 104.65669250488281 - moving ave loss 104.59910300262905 step 610 - loss 104.4439697265625 - moving ave loss 104.5835896750224 step 611 - loss 104.50250244140625 - moving ave loss 104.57548095166078 step 612 - loss 104.66641235351562 - moving ave loss 104.58457409184626 step 613 - loss 104.51042175292969 - moving ave loss 104.57715885795461 step 614 - loss 104.57950592041016 - moving ave loss 104.57739356420016 step 615 - loss 104.4698257446289 - moving ave loss 104.56663678224304 step 616 - loss 104.62855529785156 - moving ave loss 104.5728286338039 step 617 - loss 104.53482818603516 - moving ave loss 104.56902858902703 step 618 - loss 104.41508483886719 - moving ave loss 104.55363421401105 step 619 - loss 104.50767517089844 - moving ave loss 104.5490383096998

So As you can see its taking too much time and their is no significant progress.
I have also posted in stackoverflow #57143339

error in generate_xml

code
xml_str = ET.tostring(annotation)
print(xml_str)
root = etree.fromstring(xml_str)
xml_str=etree.tostring(root, pretty_print=True)
save_path = os.path.join(savedir, img.name.replace('jpg','xml'))
with open(save_path,'wb') as temp_xml:
temp_xml.write(xml_str)
Error
Traceback (most recent call last):
File "C:\Users\subha\AppData\Local\Programs\Python\Python36\lib\site-packages\matplotlib\cbook_init_.py", line 216, in process
func(*args, **kwargs)
File "make_annotation.py", line 31, in onkeypress
write_xml(image_folder, img, object_list, tl_list, br_list, savedir)
File "C:\VIT\SET\CODE\darkflow-master\new_model_data\generate_annotation.py", line 36, in write_xml
root = etree.fromstring(xml_str)
File "src\lxml\etree.pyx", line 3234, in lxml.etree.fromstring
File "src\lxml\parser.pxi", line 1876, in lxml.etree._parseMemoryDocument
File "src\lxml\parser.pxi", line 1764, in lxml.etree._parseDoc
File "src\lxml\parser.pxi", line 1127, in lxml.etree._BaseParser._parseDoc
File "src\lxml\parser.pxi", line 601, in lxml.etree._ParserContext._handleParseResultDoc
File "src\lxml\parser.pxi", line 711, in lxml.etree._handleParseResult
File "src\lxml\parser.pxi", line 640, in lxml.etree._raiseParseError
File "", line 1
lxml.etree.XMLSyntaxError: StartTag: invalid element name, line 1, column 237
xml_str contains
b'imagesreal_00001.jpg06006003facesUnspecified0< difficult>0</ difficult>21598597'

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.