When I using YOLO V3, how can i save detected object name with .txt file? - yolo

I am first using YOLO V3 for my project. I had finished testing detecting dog. horse... etc. But I only got images result. I want to get detected object's name as
txt file. For Example, I tested dog.jpg and there is a txt file created. inside of txt file, it written "dog".
help me how can I get Object's name result by with txt file.

If you don't want to modify the source code, try to use this popular repository https://github.com/AlexeyAB/darknet which has a feature to save the detection result's information
Example : To process a list of images data/train.txt and save results of detection to result.txt use:
./darknet detector test cfg/voc.data yolo-voc.cfg yolo-voc.weights -dont_show -ext_output < data/train.txt > result.txt
Now you can open the result.txt and see all information related to your detection result

Related

gdal_translate NetCDF to GeoTiff file conversion not working

I am new to geospatial analytics and using NetCDF and GeoTIFF files. I am trying to convert the NetCDF file into GeoTIFF file. I came across this reference: netcdf-to-geotiff-file-conversion. I have successfully installed and can run gdal_translate in my MacOS terminal. However, I get this message I am trying to understand what this means and what I am missing? This appears to be warning, however it didn't generate any output.
My code executed:
gdal_translate some_nc_file_name.nc output.tif
Error/Message:
Warning 1: No UNIDATA NC_GLOBAL:Conventions attribute
Input file contains subdatasets. Please, select one of them for reading.
Here is my data output I previewed in Python:
You appear to have multiple variables in the file, so need to select one. Example (following https://nsidc.org/support/how/how-convert-golive-netcdf-variables-geotiff).
gdal_translate NETCDF:"Input_FileName.nc":variable_name Output_FileName.tif
Based on the warning message, the netCDF file lacks certain important attributes, so some issues may exist with the coordinates etc. in the tif.

importing training data to CloudML with images that do not have a file-extension

i created some training data and put the CSV in the google-storage, but it looks like the import won't work when the files do not have a proper .jpg extension:
Error: INVALID_ROW: Invalid input found at row 1 of gs://weg-li-production/training/test.csv: "Unsupported file extension."
values look like this:
TRAIN,gs://weg-li-production/d7nwcheo8774rvbcgj4lyta3athj,Opel
is there a way to work around this issue?
It seems you put the whole "TRAIN,gs://weg-li-production/d7nwcheo8774rvbcgj4lyta3athj,Opel" into a single unit in your csv file. The comma should represent another unit in the csv file. You can open it in Excel to check your csv file, and the correct format should include three columns in Excel.
Assuming gs://weg-li-production/d7nwcheo8774rvbcgj4lyta3athj is the image file & Opel is the label. It all looks fine, just that the image file name does not have a valid extension.
Check https://cloud.google.com/vision/automl/docs/prepare for valid file types (extension), during training & predictions

Train Tesseract to label icons

I'm trying to create training data for Tesseract 4.0 to identify icons (like, comment, share, save) in screenshots. This is a sample screenshot:
I would like to fine tune the Tesseract to achieve output as below:
Like 147
Comment 29
Saved 5
Actions
58
Actions
Profile Visits 24
Follows 2
I have followed step-by-step as stated in https://pretius.com/how-to-prepare-training-files-for-tesseract-ocr-and-improve-characters-recognition/
I modified the box file as below:
- Heart : Like
- Speech bubble: Comment
- Bookmark: Saved
- Arrow: Share
But, the final training data failed to read the icon as I wanted. Example of error I've got is 'Like is not in unicharset'. Do I have to do something different when creating the unicharset for icons?
I've figured it out. The box editor expects single letter/number instead of full words. I have used Unicode character to interpret my icons. The steps are as below:
Crop all target icons that you wish for Tesseract to detect and save it in one file named as (in my case) own.std.exp0.png
Create box file using the command 'tesseract own.std.exp0.png own.std.exp0 makebox'
Open jTessBoxEditor and input unicode at the char column. The list of supported unicode can be found under program Character Map (https://sites.psu.edu/symbolcodes/windows/charmap/). Example: For heart symbol I used U+2665. Note that some unicode are not supported. It shows as blank square. So, keep trying till you find one that works. My final edited box file looks like this.
Create the final training file which will be own.trainneddata (can be done as shown here https://medium.com/apegroup-texts/training-tesseract-for-labels-receipts-and-such-690f452e8f79 or train using jTessBoxEditor).
Copy the own.traineddata to the directory Tesseract/tessdata and run Tesseract using lang='own+eng'. I used pytesseract and the output is as below:

Is there anyone success to generate midi from TFRecode file with magenta?

I got TFRecode file from magenta but it's difficult(and not precise description for me) to get midi file...
whoever solve this issue, share plz.
Known descrioption from Magenta groups(https://groups.google.com/a/tensorflow.org/forum/#!topic/magenta-discuss/)
The output format for the script is not a MIDI file. It is a TFRecord file containing NoteSequence protobufs with equivalent (but more readable and easily modifiable) representations of the input MIDIs.
You should be able to use sequence_proto_to_pretty_midi and then save the PrettyMIDI object as a midi file:
https://github.com/tensorflow/magenta/blob/master/magenta/lib/midi_io.py#L164
As an exercise, you might try to use the functions in note_sequence_io.py and midi_io.py to convert this file back to MIDIs.
If i achieve it I will share it for you also!
thx
We've recently added a model that you can train to generate new sequences. Have a look at https://github.com/tensorflow/magenta/blob/master/magenta/models/basic_rnn/README.md.
Thanks!

Ansys multiphysics: blank output file

I have a model of a heating process on Ansys Multiphysics, V11.
After running the simulation, I have a script to plot a temperature profile:
!---------------- POST PROCESSING -----------------------
/post1 ! tdatabase postprocessor
!---define profile temperature
path,s_temp1,2,,100 ! define a path
ppath,1,,dop/2,0,0 ! create a path point
ppath,2,,dop/2,1.5,0 ! create a path point
PDEF,surf_t1,TEMP, ,noav ! print a path
plpath,surf_t1 ! plot a path
What I now need, is to save the resulting path in a text file. I have already looked online for a solution, and found the following code to do it, which I appended after the lines above:
/OUTPUT,filename,extension
PRPATH,surf_t1
/OUTPUT
Ansys generates the file filename.extension but it is empty. I tried to place the OUTPUT command in a few locations in the script, but without any success.
I suspect I need to define something else, but I have no idea where to look, as Ansys documentation online is terribly chaotic, and all internet pages I've opened before writing this question are not better.
A final note: Ansys V11 is an old version of the software, but I don't want to upgrade it and fit the old model to the new software.
For the output of the simulation (which includes all calculation steps, and sub-steps description and node-by-node results) the output must be declared in the beginning of the code, and not in the postprocessing phase.
Declaring
/OUTPUT,filename,extension
in the preamble of the main script makes such that the output is stored in the right location, with the desired extension. At the end of the scripts, you must then declare
/OUTPUT
to reset the output file location for ANSYS.
The output to the PATH call made in the postprocessing script is however not printed in the file.
It is convenient to use
*CFOPEN,file,ext
*VWRITE,Vector(1,1).Vector(1,2)
(2F12.6)
*CFCLOSE
where Vector(1,1) is a two column array created by *DIM, and stores your data to output to file
As this is a special command, run it from file i.e. macro_output.mac