Giter VIP home page Giter VIP logo

myptv's People

Contributors

alexlib avatar ronshnapp 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

Watchers

 avatar  avatar  avatar

myptv's Issues

Why not post package to pip?

Is there any particular reason that your installation instructions require download source code and running pip? Why not post the package to pip and/or conda-forge?

camera orientation initial guess files are missing in /example

The manual suggests creating an empty file and starting iterations of 1-2 in the calibration, but this process does not converge to anything useful for the cam1 in /example. I suggest adding some explanation on how to create a reasonable initial guess or providing some file that a user can iterate 3-5 times and reach some result.

Please add community guidelines

The "Who manages this project?" section of the Readme covers some, but not all, of the JOSS requirements ("Are there clear guidelines for third parties wishing to 1) Contribute to the software 2) Report issues or problems with the software 3) Seek support").

Please add/expand guidelines, especially for reporting issues and seeking support.

error in the example ?

@ronshnapp

`(myptv) PS C:\Users\alex\repos\MyPTV\example> python workflow.py params_file.yml calibration

given inputs -
params file name: params_file.yml
action: calibration

camera files not detected in the working directory.
Generating a new empty file and leaving calib. sequence.
To continue calibration, fill in an initial guess in the
empty file, and then run again the calibration sequence.
Traceback (most recent call last):
File "C:\Users\alex\repos\MyPTV\example\workflow.py", line 575, in
wf = workflow(fname, action)
File "C:\Users\alex\repos\MyPTV\example\workflow.py", line 63, in init
self.calibration_sequence()
File "C:\Users\alex\repos\MyPTV\example\workflow.py", line 261, in calibration_sequence
cam.save('.')
UnboundLocalError: local variable 'cam' referenced before assignment`

Legacy calibration example

The purpose of the legacy_calibration_example folder in the example folder isn't clear (not mentioned in user manual). Since you recommend copying this directory structure for a new experiment, should this folder be removed or explained?

example folder .ipynb_checkpoints

To keep the example directory cleaner (as a better template), you could remove .ipynb_checkpoints. You could add .ipynb_checkpoints to .gitignore so that they won't be pushed.

Test test_segmentation fails with TypeError

When I installed MyPTV and run its tests, 5 tests passed, but test_segmentation test failed with TypeError

This is a fresh system with Ubuntu 20.04
I made sure to only install python3 and pip3, without python2 packages.

Error (see error1.txt for more context):

>       i0 = (self.image_start is not None) * self.image_start
E       TypeError: unsupported operand type(s) for *: 'bool' and 'NoneType'

myptv/segmentation_mod.py:458: TypeError

The commands I executed, in order:

git clone 
cd MyPTV/
pip --version
pip install .
sudo apt install python3-pytest
pytest-3 ./tests/ -W ignore:RuntimeWarning
pytest-3 .

Output of pytest-3 .
error1.txt

Versions:

:~/projects/MyPTV$ python3 --version
 Python 3.8.10                                                                                           
~/projects/MyPTV$ pip --version                                                     
 pip 20.0.2 from /usr/lib/python3/dist-packages/pip (python 3.8)                                         
~/projects/MyPTV$ pytest-3 --version                                                
 This is pytest version 4.6.9, imported from /usr/lib/python3/dist-packages/pytest.py                    

DOC - Calibration Section

I'm going to consolidate a couple small documentation issues related to the calibration section (2.2) of the user manual here.

Acceptance blockers:

  • Incomplete initial guess directions (2.2.2 Initial Calibration step 2). The directions ask for initial guesses for camera position, but the new camera file is also generated with a value of f = 1. f does not appear to change (stays at 1) when running the calibration - this leads to high reprojection errors and calibrations that don't converge within reasonable time.

Other:

  • The calibration_points_gui workflow option is mentioned in 2.2 Calibration guide, but not in 2.1.1 The workflow.py script, which only lists 7 options for the workflow command. Please also check for other hidden workflow options and include a complete list in 2.1.1.
  • 2.2.2 Initial Calibration step 3 mentions choosing 6 calibration points for initial calibration - in addition to having asymmetry in point selection, the 6 points also shouldn't all be coplanar. I'd encourage you to mention this specifically in the docs. It's also a little confusing that the example folder has more than 6 points for each camera for this step (maybe say "at least 6 points" in the docs?)

DOC - typos

I'm going to consolidate a few typos in the user manual into this issue, focusing on those that could confuse a user:

  • Section 2.1 of the user manual (Preparation of an experiment folder) step 3 refers to workfolw.py instead of workflow.py I don't think a user would misunderstand, but given it's the core script for running the code it's worth fixing
  • Reference 1 of the user manual has an incomplete journal title

Installation (Conda directions)

OS: Windows 10
Python Version: Miniconda3 Conda 4.12.0 Python 3.9.7

The conda installation directions are missing a minor step after setting up the conda environment. myptv imports in the root folder and the tests run but myptv will not import in the example folder (to run the example workflow) unless installed after setting up the conda environment (e.g. using pip or setup.py). The directions should include this step for completeness.

Has compatibility issues with most recent version of Pillow

After a fresh install, I ran the initial_calibration command of workflow.py and tried to use +/- to zoom.
The following error appeared:

Exception in Tkinter callback
Traceback (most recent call last):
  File "C:\Users\admin_user\.pyenv\pyenv-win\versions\3.11.5\Lib\tkinter\__init__.py", line 1948, in __call__
    return self.func(*args)
           ^^^^^^^^^^^^^^^^
  File "D:\MyPTV\Test-Project\.venv\Lib\site-packages\myptv\gui_intial_cal.py", line 792, in zoomIn
    Image.ANTIALIAS)
    ^^^^^^^^^^^^^^^
AttributeError: module 'PIL.Image' has no attribute 'ANTIALIAS'

I could get around this issue by downgrading my Pillow to 9.5.0, since in 10.0.0 some attributes were deprecated. But still, probably worth fixing, or else putting the pillow version in the install guide.

Example of using the actual functions?

I installed the package and ran all the workflow.py related options in the examples folder, but then I wanted to see some animations of particles flying around but the examples dried up. You've done a great job of explaining the details of the package in the user_guide but I was hoping for a higher-level demonstration of the whole package. Like an example that takes the calibration and other outputs from workflow.py and actually does something with them, like just the bare basics. The user guide can then elaborate on the how and why of each step. This is not a requirement for publication, just a suggestion as a very newbie user. In other words, in the readme you say do from myptv import imaging_mod to start using the package, but no further explanations, which seems like you left me hanging.

bug or feature?

(myptv) PS C:\Users\alex\repos\test_cavity_myptv\example> python ../myptv/example/workflow.py .\params_file.yml matching

 given inputs -
params file name: .\params_file.yml
action: matching

Starting stereo-matching.

Traceback (most recent call last):
  File "C:\Users\alex\repos\test_cavity_myptv\myptv\example\workflow.py", line 623, in <module>
    wf = workflow(fname, action)
  File "C:\Users\alex\repos\test_cavity_myptv\myptv\example\workflow.py", line 75, in __init__
    self.do_matching()
  File "C:\Users\alex\repos\test_cavity_myptv\myptv\example\workflow.py", line 480, in do_matching
    mbf.get_particles(frames=frames)
  File "C:\Users\alex\miniconda3\envs\myptv\lib\site-packages\myptv\particle_matching_mod.py", line 161, in get_particles
    itm = initiate_time_matching(self.imsys, pd, pd1,
  File "C:\Users\alex\miniconda3\envs\myptv\lib\site-packages\myptv\particle_matching_mod.py", line 713, in __init__
    self.trees[k] = KDTree(self.pd1[k])
  File "C:\Users\alex\miniconda3\envs\myptv\lib\site-packages\scipy\spatial\_kdtree.py", line 343, in __init__
    super().__init__(data, leafsize, compact_nodes, copy_data,
  File "_ckdtree.pyx", line 567, in scipy.spatial._ckdtree.cKDTree.__init__
ValueError: data must be 2 dimensions

example_cal folder

It's not clear what the purpose of the folder is from the user manual. Some of the data also appears to be a different format than that in the example/calibration folder, if this is an old calibration procedure it's likely best to remove to avoid confusing users. If it's part of a test case maybe it should move out of the main directory?

Complete OpenPTV-like example

@ronshnapp it would be great if we consider a few things that will make all the adoption easier:

  1. one complete experiment example - e.g. https://github.com/openptv/test_cavity, along with the post-processing and plots, or maybe your jet on figshare
  2. we can do a zoom chat with you explaining to me all the analysis and all the insight and we record it as a tutorial for the followers

JOSS paper feedback

I'll consolidate my feedback on the JOSS software paper here. Overall, I'm excited about this software and have primarily minor comments on the paper.

Major:

  • "State of the field" review criteria (Do the authors describe how this software compares to other commonly-used packages?): Most comparisons in the paper are to OpenPTV, which makes sense for this project, but more comparisons (e.g., ImageJ ParticleTracker, OpenLPT) could be valuable to users trying to decide what software to use

Minor:

  • The "Tests" heading is slightly confusing in this context, can you make clearer you're referring to an example experiment implementation and not a summary of the software test cases?
  • Please directly state your working fluid (I'm assuming water, which makes that calibration error even more impressive, but this should be included in the setup details) somewhere in the experiment description

Typos:

  • Line 41 - extra _ (or formatting error) in one mention of MyPTV
  • Line 158 - incomplete reference journal title (also in user manual)

Error in stitching step in 2D tracking

When doing stitching step after 2D_tracking steps, error comes out as:

given inputs -
params file name: params_file.yml
action: stitching

starting at 60 trajectories
with 63.7 samples per trajectory on average

searching for candidates to connect:
Traceback (most recent call last):
File "workflow.py", line 1028, in
wf = workflow(fname, action)
File "workflow.py", line 93, in init
self.do_stitching()
File "workflow.py", line 926, in do_stitching
ts.stitch_trajectories()
File "C:\ProgramData\Anaconda3\lib\site-packages\myptv\traj_stitching_mod.py", line 368, in stitch_trajectories
self.calc_dij()
File "C:\ProgramData\Anaconda3\lib\site-packages\myptv\traj_stitching_mod.py", line 161, in calc_dij
v = gradient(x, axis=0)
File "<array_function internals>", line 6, in gradient
File "C:\ProgramData\Anaconda3\lib\site-packages\numpy\lib\function_base.py", line 1065, in gradient
"Shape of array too small to calculate a numerical gradient, "
ValueError: Shape of array too small to calculate a numerical gradient, at least (edge_order + 1) elements are required.

I guess it may relate to the disagreement between 3D and 2D stitching or improper setting parameters. Here I set them as:

stitching:
trajectory_file: trajectories_2D
max_time_separation: 3
max_distance: 5
save_name: trajecotries_stitched

Example calibration rotation

Hello! I'm trying to understand the rotation angles for calibration. In Figure 5, should the rotation vector for b) be (-1/4pi, -3/4pi, 0) instead of (-1/2pi, -3/4pi, 0)? Or perhaps let me know if I am misunderstanding the transformation. Thanks!

Bug - Changing segmentation method to 'dilation' missing 'particle_size'

Testing the dilation segmentation method with otherwise default values throws NameError. Particle_size may not be extracted correctly from the params_file.yml?

Operating System: Windows 10
Python Version: Miniconda3 Conda 4.12.0 Python 3.9.7

Parameters:

- segmentation:
    Number_of_images: 1
    images_folder: Calibration
    single_image_name: cal2.tif
    image_extension: '.tif'
    mask: 1.0
    ROI: 227, 1050, 120, 920
    plot_result: True
    threshold: 42
    median: 5
    blur_sigma: None
    local_filter: None
    min_xsize: 1.0
    min_ysize: 1.0
    min_mass: 60.0
    max_xsize: 15.0
    max_ysize: 15.0
    max_mass: None
    method: dilation 
    particle_size: 8
    save_name: None

Error:

Traceback (most recent call last):
  File "MyPTV\example\workflow.py", line 719, in <module>
    wf = workflow(fname, action)
  File "MyPTV\example\workflow.py", line 76, in __init__
    self.do_segmentation()
  File "MyPTV\example\workflow.py", line 429, in do_segmentation
    if method=='dilation' and type(particle_size) != int:
NameError: name 'particle_size' is not defined

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.