Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hi project you done is perfect but some errors adressed for me #1

Open
vishnuproject opened this issue Oct 28, 2019 · 12 comments
Open

Comments

@vishnuproject
Copy link

project you done is excellent can you help me with issues i was facing during execution
Screenshot from 2019-10-28 19-45-57

@dronefreak
Copy link
Owner

Hi,

Thanks for your comment.
I think that this a typo, you need to put Tracker instead of tracker.
So you new command shall be:

self.tracker = Tracker(self.vid_stream.height,
                               self.vid_stream.width,
                               green_lower, green_upper)

You could also remove this entire line, I was using it to create a tracking algorithm initially.

@vishnuproject
Copy link
Author

hi the i was getting image and it is getting stuck no video feed is recieving but a new tab is opening and drone is not flying i have done upto here because of you please help me with the issues i was facing and i have to say your code was solid

@vishnuproject vishnuproject reopened this Nov 9, 2019
@dronefreak
Copy link
Owner

Hi,

Thanks a lot for appreciating this work. I am not sure why there is a lag in your video feed. I personally almost never faced this 'getting stuck' issue. I did face certain lag, but it was not this bad.

I would like to investigate more before commenting anything. To begin with, could you please share with me the specifications of your machine. I just want to confirm whether the profile matches with the requirements, because Mask RCNN is a very computationally expensive process and requires large GPU memories to run smoothly. After this we can move on to code investigation.

@vishnuproject
Copy link
Author

hi yeah thanks for response i was using i5 9300h laptop with nvidia gtx 1650 grphics it belong to lenovo gaming series i.e legion 540

@vishnuproject
Copy link
Author

Screenshot from 2019-11-11 22-44-44

Hi i am getting some errors while executing code i have given a screenshot please help me with this and drone is not flying or take off by pressing tab and i am not getting video feed but only one image after it segments object

@dronefreak
Copy link
Owner

dronefreak commented Nov 11, 2019

Hi,

So seems like there might be a version mismatch of av. Please execute sudo pip install av --upgrade from your terminal. Also, I hope you have compiled and installed TelloPy. If not, then please do that as well from https://github.com/hanyazou/TelloPy.

After all this try executing your code and even then if does not work, please try modifying your tr.py with the following.

def main():
    drone = tellopy.Tello()
    tellotrack = TelloCV()

    try:
        drone.connect()
        drone.wait_for_connection(60.0)

        retry = 3
        container = None
        while container is None and 0 < retry:
            retry -= 1
            try:
                container = av.open(drone.get_video_stream())
            except av.AVError as ave:
                print(ave)
                print('retry...')

        # skip first 300 frames
        frame_skip = 300
        while True:
            for frame in container.decode(video=0):
                if 0 < frame_skip:
                    frame_skip = frame_skip - 1
                    continue
                start_time = time.time()
                image = tellotrack.process_frame(frame)
                results = model.detect([image], verbose=0)
                r = results[0]
                image = display_instances(
                image, r['rois'], r['masks'], r['class_ids'], class_names, r['scores'])
                cv2.imshow('tello', image)
                _ = cv2.waitKey(1) & 0xFF
                cv2.waitKey(1)
                if frame.time_base < 1.0/60:
                    time_base = 1.0/60
                else:
                    time_base = frame.time_base
                frame_skip = int((time.time() - start_time)/time_base)
                    

    except Exception as ex:
        exc_type, exc_value, exc_traceback = sys.exc_info()
        traceback.print_exception(exc_type, exc_value, exc_traceback)
        print(ex)
    finally:
        drone.quit()
        cv2.destroyAllWindows()

@vishnuproject
Copy link
Author

vishnuproject commented Nov 12, 2019 via email

@vishnuproject
Copy link
Author

hi these are the latest errors that are received after modifying the code please help me please check the screenshot below i hope it shows
Screenshot from 2019-11-13 00-55-30

@dronefreak
Copy link
Owner

Hi,

I am not sure why this error drone not defined persists, as drone = tellopy.Tello() is already defined above.
You could try drone.connect() again. However, in your modifiedtr.py, you can just use print() instead of print_execption(), so your new command could be:

print(exc_type, exc_value, exc_traceback)

@vishnuproject
Copy link
Author

hi i tried the latest suggestions but video feed is getting stuck and segmentation getting done for the first image or frame .modified code and regular code i have mailed please check your gmail my account will be vishnu as first name of my gmail in your inbox

@wxbs
Copy link

wxbs commented Apr 9, 2022

hi i tried the latest suggestions but video feed is getting stuck and segmentation getting done for the first image or frame .modified code and regular code i have mailed please check your gmail my account will be vishnu as first name of my gmail in your inbox

Hi, has the problem "video feed is getting stuck and segmentation getting done for the first image or frame" been solved? I met this problem,too

@wxbs
Copy link

wxbs commented Apr 9, 2022

I found that if I use "ctrl" I can't click into the "open" of av.open(). Does anyone know why?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants