-
Notifications
You must be signed in to change notification settings - Fork 86
Is it possible to get the status update in JSON format? #140
Comments
No, never considered. Why do you want that information?? you can see quick summary at the end of application.. or may be you want silent option? |
He probably wants to parse it with another program to get progress bars 'n stuff, would be my guess. You could just use regex, there isn't much variation in the messages, shouldn't be too hard. |
@DeadSix27 Correct. For progress bar. I'm using RegEx now but it has some issues: For all output from directory I'm parsing for, "[1/300] 'image.png'" in the standard out,
But when converting a single image there is no image status. In JSON it would be an object like this:
For a single image there is no
What are the values (1,2) and they start over? Are they out of order if using more than one thread? |
I'll see about adding [1/1] for now, the json part requires more work. Is this better?: Silent mode: click to expand log
Verbose mode: click to expand log
|
@DeadSix27 I sort of found a way to get the progress.
I like, "Working on file #1/1 "7KMAtWE.jpg" but I would also keep the same format for start process block for now,
The reason I was seeing different numbers was that I was parsing the statement,
I'll wait for a JSON solution. But if there was a property that had the step you were on (increment it in the loop) that would show the progress. start process block (0,0) ... I'm not interested in the iteration information personally. |
I changed way more than that, see #141 Overall its focused on viewability, rather than parseability. but the (x/y,x/y) imo is easier to parse so.. But I'll be looking into a JSON format, shouldn't be too hard now that i use printf universally. |
I updated my previous comment (last previous comment). What do those values mean |
Its: (current_column/total_columns, current_row/total_rows) The reason it goes to 0 again, is because of the filter and scale process.. first it filters, e.g 0/4,0/4 |
PS, Maybe this demonstrates it better: click to expand
As you can see, it goes from 1/3,/14 to 3/3,4/4 for the filter process then it switches to the scale process, announced via: That said, I should look into making it show that it's filtering first and also the amount of 2x scales it does if you have a higher scale_factor EDIT 2: it goes column by column, then row by row. |
Is it always the same amount of columns and rows? If it is different depending on scale values is it possible to get the scale values and columns and rows counts up front? |
You get the total rows and columns once the process starts |
That said, there is also this change: #147
|
I don't think print to JSON is essential feature and there is more cons then pros. now: cui: call w2x lib to work maybe: cui: call w2x lib and handle logs.
we can use pipelining and network technique to implement messaging feature. |
What if we put it behind a flag? I'm not saying to use JSON by default because it may break other applications expecting the same format. If a flag is set then then return JSON. JSON:
Results:
If you are worried about speed that's OK maybe people use it for single images. Or you can build a JSON string by hand. For example, you can create a JSON string easily without using JSON utilities:
But then again, if you are putting it behind a command line argument and it is not on by default then the user can say, I will accept 1 millisecond to get JSON format. :) |
you mean only JSON for Iteration part? It is not required many time but.. it is only needed for special case.. and nothing changed i think.. and.. regex need 1 single line to read it without JSON too. does it changes something?? fully JSON parsed so like pack one images result in single JSON is not you meant? only single line of output?? as our print is seperated in many function so we need to combine it to single logging function to build it to one JSON Object. but if only Iteration part, it takes 1 min to implement it. as you said. is it what you need? |
as @DeadSix27 wants to implement logging feature for who use w2x lib, so I suggest messaging and it can be used in JSON thing. use messaging between w2x lib and front-end program and make JSON on front-end based on standard messaging protocol. it won't be slow down anything and also, you can make JSON in front-end. I mean, No JSON fucntion in w2x lib, and implement in front-end is better and faster. This can make w2x lib more library. |
I have a front end and want to show progress of current image and if processing multiple then overall progress.
I suggest using JSON because it is easy to add new properties. If you update a string with more or less info then you have to update your RegEx. If you update a JSON it is a new property your software can safely ignore. I don't follow the diagram but I think @DeadSix27 understands what I'm suggesting. |
umm what i mean is waifu2x-converter-cpp 's CUI is "front-end" program. anyway it is not subject what i'm saying. like Win32API struct packet{ Define of W2X_CONV_ITERATION packet::
struct packet recived; swtich(recived.message) obj.add("iteration", read_int(recived, &offset)); case: W2X_CONV_START_PROCESS_BLOCK: obj.add("row", read_int(recived, &offset)); . } somthing like this. example is in case with JSON making. but it is hard too. if we can print json in easy way it will be fine. |
Is it possible to get the status update in JSON format?
Currently the output is:
The text was updated successfully, but these errors were encountered: