borevitzlab / timestreamlib

DEPRECATED. Please use the current version of the TimeStream tools at https://gitlab.com/appf-anu/pyts2.
https://gitlab.com/appf-anu/pyts2
GNU General Public License v3.0
7 stars 4 forks source link

Error messages should be more informative (pipeline_demo.py) #63

Closed chuong closed 10 years ago

chuong commented 10 years ago

I tried the latest script today but got a many error messages complaining missing inputs even though these inputs are provided in pipeline.yml and timestream.yml:

$ python pipeline_demo.py  -i /home/chuong/Data/phenocam/a_data/TimeStreams/Borevitz/BVZ0036/BVZ0036-GC05R-C01~fullres-orig -o /home/chuong/Data/phenocam/a_data/TimeStreams/Borevitz/BVZ0036/BVZ0036-GC05R-C01~fullres-chuong-test
pipeline._9.mess=---Writing Features---
pipeline._9.name=writefeatures_csv
pipeline._8.mess=---Extract Plant Features---
pipeline._8.name=featureextract
pipeline._8.features=['all']
pipeline._7.mess=---Writing Image---
pipeline._7.name=imagewrite
pipeline._7.outstream=segg
pipeline._6.mess=---Performing plant segmentation---
pipeline._6.methargs={'threshold': 0.6, 'kSize': 5, 'blobMinSize': 50}
pipeline._6.name=plantextract
pipeline._6.method=method1
pipeline._5.potFile=Pot.png
pipeline._5.name=potdetect
pipeline._5.mess=---Perform pot detection---
pipeline._5.potPositions=[3075.7731696472, 1555.6248980913108]
pipeline._5.potSize=[271, 278]
pipeline._5.potTemplateFile=PotTemplate.png
pipeline._5.traySize=[1155, 1369]
pipeline._4.trayFiles=Tray_%02d.png
pipeline._4.name=traydetect
pipeline._4.mess=---Perform tray detection---
pipeline._4.trayNumber=8
pipeline._4.settingPath=_data
pipeline._4.trayPositions=[[769.8614778705123, 2459.8952985945198], [1983.3218079445069, 2477.086304095753], [3226.049545720228, 2481.143605746123], [4448.643579645086, 2499.29641014711], [768.3232767702657, 1016.2193047062192], [1994.4364112452467, 999.5856008553558], [3223.0877468204744, 1007.1429025057257], [4446.624479094962, 1013.2384052563424]]
pipeline._3.mess=---Write image---
pipeline._3.name=imagewrite
pipeline._3.outstream=corr
pipeline._2.mess=---Perform color correction---
pipeline._2.minIntensity=15
pipeline._2.name=colorcorrect
pipeline._1.mess=---Perform color card detection---
pipeline._1.colorcardFile=CapturedColorcard.png
pipeline._1.colorcardPosition=[2763.8665252432197, 1578.0483581906267]
pipeline._1.colorcardTrueColors=[[115.0, 196.0, 91.0, 94.0, 129.0, 98.0, 223.0, 58.0, 194.0, 93.0, 162.0, 229.0, 49.0, 77.0, 173.0, 241.0, 190.0, 0.0, 242.0, 203.0, 162.0, 120.0, 84.0, 50.0], [83.0, 147.0, 122.0, 108.0, 128.0, 190.0, 124.0, 92.0, 82.0, 60.0, 190.0, 158.0, 66.0, 153.0, 57.0, 201.0, 85.0, 135.0, 243.0, 203.0, 163.0, 120.0, 84.0, 50.0], [68.0, 127.0, 155.0, 66.0, 176.0, 168.0, 47.0, 174.0, 96.0, 103.0, 62.0, 41.0, 147.0, 71.0, 60.0, 25.0, 150.0, 166.0, 245.0, 204.0, 162.0, 120.0, 84.0, 52.0]]
pipeline._1.name=colorcarddetect
pipeline._0.imageSize=[5184, 3456]
pipeline._0.mess=---Perform optical undistortion---
pipeline._0.cameraMatrix=[[4234.949389, 0.0, 2591.5], [0.0, 4234.949389, 1727.5], [0.0, 0.0, 1.0]]
pipeline._0.rotationAngle=180.0
pipeline._0.distortCoefs=[-0.166191, 0.142034, 0.0, 0.0, 0.0]
pipeline._0.name=undistort
outstreams._1.name=corr
outstreams._0.name=segg
general.endHourRange.second=0
general.endHourRange.minute=0
general.endHourRange.hour=15
general.startDate.hour=9
general.startDate.month=6
general.startDate.second=0
general.startDate.year=2014
general.startDate.day=18
general.startDate.minute=0
general.timeInterval=900
general.visualise=False
general.startHourRange.second=0
general.startHourRange.minute=0
general.startHourRange.hour=9

Timestream instance created:
   ts.path: /home/chuong/Data/phenocam/a_data/TimeStreams/Borevitz/BVZ0036/BVZ0036-GC05R-C01~fullres-orig
   ts.name: BVZ0036-GC05R-C01~fullres-orig
   ts.version: 1
   ts.start_datetime: 2014-06-18 18:30:00
   ts.end_datetime: 2014-08-06 07:30:00
   ts.image_type: jpg
   ts.extension: JPG
   ts.interval: 1800
Traceback (most recent call last):
  File "pipeline_demo.py", line 146, in <module>
    pl = pipeline.ImagePipeline(plConf.pipeline, ctx)
  File "/home/chuong/Workspace/timestreamlib/timestream/manipulate/pipeline.py", line 73, in __init__
    self.pipeline.append( component(context, **setElem) )
  File "/home/chuong/Workspace/timestreamlib/timestream/manipulate/pipecomponents.py", line 173, in __init__
    super(ColorCardDetector, self).__init__(**kwargs)
  File "/home/chuong/Workspace/timestreamlib/timestream/manipulate/pipecomponents.py", line 62, in __init__
    raise PCExBadRunExpects(self.__class__)
timestream.manipulate.pipecomponents.PCExBadRunExpects: PipeComp_Error: The call to colorcarddetect should consider 
  colorcarddetect
  (Initializing Args)
    minIntensity(optional): Skip colorcard detection if intensity below this value
    mess(required): Detect color card
    colorcardTrueColors(required): Matrix representing the groundtrue color card colors
    colorcardFile(required): Path to the color card file
    settingPath(required): Path to setting files
    colorcardPosition(required): (x,y) of the colorcard
  (Args Received)
    <class 'timestream.TimeStreamImage'>
  (Args Returned)
    <class 'timestream.TimeStreamImage'>
    <type 'list'>

$
kdm9 commented 10 years ago

Chuong,

please use backticks around any copy-pasing:

paste code

goes nicely to:

paste code

I fixed you bug report here, it's now a lot easier on the eyes.

Cheers, K

Joelgranados commented 10 years ago

chuong can you paste your configuration files? I'll try to reproduce on my end.

chuong commented 10 years ago

Here is the content of timestream.yml for BVZ0036-GC05R-C01~fullres-orig:

colorcarddetect:
  colorcardFile: CapturedColorcard.png
  colorcardPosition: [2763.8665252432197, 1578.0483581906267]
  colorcardTrueColors:
  - [115.0, 196.0, 91.0, 94.0, 129.0, 98.0, 223.0, 58.0, 194.0, 93.0, 162.0, 229.0,
    49.0, 77.0, 173.0, 241.0, 190.0, 0.0, 242.0, 203.0, 162.0, 120.0, 84.0, 50.0]
  - [83.0, 147.0, 122.0, 108.0, 128.0, 190.0, 124.0, 92.0, 82.0, 60.0, 190.0, 158.0,
    66.0, 153.0, 57.0, 201.0, 85.0, 135.0, 243.0, 203.0, 163.0, 120.0, 84.0, 50.0]
  - [68.0, 127.0, 155.0, 66.0, 176.0, 168.0, 47.0, 174.0, 96.0, 103.0, 62.0, 41.0,
    147.0, 71.0, 60.0, 25.0, 150.0, 166.0, 245.0, 204.0, 162.0, 120.0, 84.0, 52.0]
colorcorrect: {minIntensity: 15}
plantextract:
  methargs: {blobMinSize: 50, kSize: 5, threshold: 0.6}
  method: method1
potdetect:
  potFile: Pot.png
  potPositions: [3075.7731696472, 1555.6248980913108]
  potSize: [271, 278]
  potTemplateFile: PotTemplate.png
  traySize: [1155, 1369]
traydetect:
  settingPath: _data
  trayFiles: Tray_%02d.png
  trayNumber: 8
  trayPositions:
  - [769.8614778705123, 2459.8952985945198]
  - [1983.3218079445069, 2477.086304095753]
  - [3226.049545720228, 2481.143605746123]
  - [4448.643579645086, 2499.29641014711]
  - [768.3232767702657, 1016.2193047062192]
  - [1994.4364112452467, 999.5856008553558]
  - [3223.0877468204744, 1007.1429025057257]
  - [4446.624479094962, 1013.2384052563424]
undistort:
  cameraMatrix:
  - [4234.949389, 0.0, 2591.5]
  - [0.0, 4234.949389, 1727.5]
  - [0.0, 0.0, 1.0]
  distortCoefs: [-0.166191, 0.142034, 0.0, 0.0, 0.0]
  imageSize: [5184, 3456]
  rotationAngle: 180.0
Joelgranados commented 10 years ago

Can you also paste the pipeline.yml

chuong commented 10 years ago

Sorry I am at home now so I don't access to the folder. The pipeline.yml is in the folder /mnt/phenocam/a_data/TimeStreams/Borevitz/BVZ0036/BVZ0036-GC05R-C01~fullres-orig/_data

This file should be quite the similar to other pipeline.yml of this experiment

chuong commented 10 years ago

I found that some sections of my timestream.yml don't have settingPath entry so I add this. Another problem with my timestream.yml is the mispelling of method: method1, instead of `meth: method1. These are all fixed now. The error message needs to be more informative to locate the source of the error.

Now I have potdetection error which is an unrelated to the reported issues

Joelgranados commented 10 years ago

Re-opening so we get better at producing error messages

chuong commented 10 years ago

I just made a change to PCExBadRunExpects to make the error message more informative.

chuong commented 10 years ago

To reproduce the error, just randomly remove some entries from a working pipeline.yml or timestream.yml.

Joelgranados commented 10 years ago

Closing, seems Chuong took care of it :)