agisoft-llc / metashape-scripts

Python scripts for Metashape (former PhotoScan)
MIT License
355 stars 200 forks source link

metashape-scripts - detect_objects.py error #58

Open MendyNagar opened 1 year ago

MendyNagar commented 1 year ago

Hi I want to use - metashape-scripts - detect_objects.py I installed everything properly, built an orthophoto and marked the cars with the name you wrote. When I run the code I get an error.

image ללא שם @PolarNick239

PolarNick239 commented 1 year ago

Hi, please share a project-reproducer to support@agisoft.com with steps to reproduce (f.e. "open project -> run script with such parameters ..."), so we were able to reproduce and investigate the problem. Probably small part of the project will be enough - just make sure that it can reproduce the problem.

MendyNagar commented 1 year ago

hey ok Can I attach a video of the process?

PolarNick239 commented 1 year ago

Yes, it will be helpful in addition to project-reproducer.

molode4ik commented 1 year ago

Hi, cv2 only accepts ASCII encoding, check encoding of your path in line 655

arpitpara commented 4 months ago

Hi I am also getting an error. Software Version - 1.7 Script Compatibility - 1.7 Error Message - ''' Metashape.CoordinateSystem.transform(p, self.chunk.shapes.crs, self.chunk.orthomosaic.crs) 2024-02-29 11:19:43 TypeError: object is not a sequence '''

What I am doing wrong?

PolarNick239 commented 4 months ago

Hi, @arpitpara, please try the latest version of the script in Metashape 2.1. Does it work?

arpitpara commented 4 months ago

I haven't checked it yet. I can't change the version due to some official issues. If it doesn't work then I will try to upgrade. Is there any solution for this version?

PolarNick239 commented 4 months ago

Please share a project-reproducer to support@agisoft.com with steps to reproduce (f.e. "open project -> run script with such parameters ..."), so we were able to reproduce and investigate the problem. Probably small part of the project will be enough - just make sure that it can reproduce the problem.

PolarNick239 commented 4 months ago

Also, please specify - do you have any shapes with attached markers in shape layers used for training zones?

arpitpara commented 4 months ago

Thanks @PolarNick239 !! I contacted support from Agisoft. And after minute tweaks it seems to work well. Now I am looking for importing the train data layer from outside and use it to train the model more precisely. Can you help me with that?

PolarNick239 commented 4 months ago

I contacted support from Agisoft. And after minute tweaks it seems to work well.

Nice!

Now I am looking for importing the train data layer from outside and use it to train the model more precisely. Can you help me with that?

Please tell me more details - what question do you have?

arpitpara commented 4 months ago

Well Till now I selected the Train Zone polygon and drew rectangles inside as Train Data layer. (Around 42 objects). The results are pretty good. But i'd like train more accurately and more in quantity of objects. I have rectangles drawn already as geojson layer through some other software. Now I want to import all those rectangles into Agisoft for training as I did manually drawing before. How can I do that?

PolarNick239 commented 4 months ago

You can use File->Import Shapes..., just make sure that your data is in compatible format (objects annotations are in different layer from train zone and so on).

Also, it is a good idea to evaluate your workflow with couple train objects, because it can take some attempts to refine workflow (to find proper format and so on), so don't annotate all objects until you ensured that your workflow works on small data.