יום חמישי, 9 באוגוסט 2018

Tensorflowsharp does not reproduce the results of python

using EdjeElectronics example and code I was able to train a date (the fruit) object detector. the proces works fine on python producing this 
almost what i need and much better than i could do on my own
now I came to the implementation task and used Tensorflowsharp as my starting point
this produces these results:
To get here i changed the tnsorflosharp object detection sample like this 

_catalogPath = "C:/Users/user 67/Downloads/TensorFlowSharp-master/Examples/ExampleObjectDetection/bin/Debug/demo/inferencegraph/labelmap.pbtxt";
         if (_catalogPath == null) {
_catalogPath = DownloadDefaultTexts (_currentDir);
}

_modelPath = "C:/Users/user 67/Downloads/TensorFlowSharp-master/Examples/ExampleObjectDetection/bin/Debug/demo/inferencegraph/frozen_inference_graph.pb";
         if (_modelPath == null) {
_modelPath = DownloadDefaultModel (_currentDir);
}

here is the source image:
Im at a loss as to what is the reason for the difference
the python runs a tensorflow 1.8 version?

well the answer was simple but not obvious
you should replace ConstructGraphToNormalizeImage (in ImageUtil.cs) with this code
private static TFGraph ConstructGraphToNormalizeImage(out TFOutput input,
                                                                out TFOutput output,
                                                                TFDataType destinationDataType = TFDataType.Float)
        {
            var graph = new TFGraph();
            input = graph.Placeholder(TFDataType.String);

            output = graph.Cast(
                graph.ExpandDims(
                    input: graph.Cast(graph.DecodeJpeg(contents: input, channels: 3), DstT: TFDataType.Float),
                    dim: graph.Const(0, "make_batch")
                    ) , destinationDataType  );
            return graph;
        }
or change the W , H, Mean and scale to the numbers the model was trained in the first place.

I could not find a source defining these constants for the models i used. so the code without constans is my choice.




יום שני, 29 בינואר 2018

למה אנשים חיים פחות בפריפריה? מקרה אישי



אתמול הבנתי למה אנשים חיים פחות בפריפריה. או לפחות סיבה אחת לכך, החסכון הבלתי פוסק של הממשלה וקופות החולים במתן שירות למשלמי המיסים. מעשה שהיה כך היה. בני בן ה15 נפצע בבוהן רגלו, לאחר שבוע כשהפצע לא החלים לקחתי אותו למרפאה. בעבר זה היה אומר ללכת לאחות בקיבוץ לפני בית ספר שתאבחן את הפצע המזוהם ותרשום לו אנטיביוטיקה שתאושר טלפונית עם הרופא ותתן לי את התרופה ממחסן התרופות בקיבוץ, עשר דקות לפני העבודה ואנחנו מסודרים. אבל היום, הקופה חסכה את הוצאות המרפאה ובעצה אחת עם המועצה האיזורית איחדה את המרפאות בקיבוצים למרפאה איזורית מה שמצריך הגעה ברכב, שאין לי ובזבוז שעת המתנה בתור לאחות ואז לרופא ואז שוב לאחות שתרשום מרשם לאנטיביוטיקה. אבל...... בזה לא תמו הצרות, את בית המרקחת של המרפאה האיזורית סגרה הקופה, את מחסן התרופות של האחיות ביטלו משרד הבריאות והקופות ואת האישור לתת מרשם לאחיות כפר ביטל משרד הבריאות. מה שאומר שאני צריך לסוע חצי שעה לבית המרקחת הקרוב (שסגור לרגל שיפוצים) לחפש את הסניף הפתוח (בצד השני של העיר) ולעמוד שעה בתור לרוקח ואז לחזור דרך פקקי העיר המתעוררת אל עבודת יומי. בסה"כ בוזבזו שלוש שעות מחיי ונסעתי כ150 ק"מ מיותרים. וכל זה מחוויר לעומת איחור של יום שלם במתן אנטיביוטיקה לנער. סיפור קטן על רמת הבריאות בפריפריה. רק בריאות
 
Locations of visitors to this page