random2222 commited on
Commit
4ac7149
·
verified ·
1 Parent(s): 08237b0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +69 -63
app.py CHANGED
@@ -328,69 +328,8 @@ def create_interface():
328
  Transform your media with professional black & white conversion and pencil sketch effects
329
  """)
330
 
331
- with gr.Tabs(value="Pencil Sketch Converter") as tabs:
332
- with gr.TabItem("Black & White Converter", elem_classes="app-card"):
333
- with gr.Tabs() as bw_tabs:
334
- with gr.TabItem("Image Processing"):
335
- with gr.Row(equal_height=True):
336
- with gr.Column(scale=1):
337
- bw_image_input = gr.Image(label="Input Image", elem_classes="input-image")
338
-
339
- with gr.Group():
340
- bw_method = gr.Radio(
341
- choices=["otsu", "adaptive", "manual"],
342
- value="otsu",
343
- label="Thresholding Method",
344
- info=otsu_tooltip,
345
- elem_classes="radio-group"
346
- )
347
-
348
- bw_threshold = gr.Slider(
349
- minimum=0,
350
- maximum=255,
351
- value=127,
352
- step=1,
353
- label="Manual Threshold Value",
354
- info=manual_tooltip,
355
- interactive=True,
356
- elem_classes="slider-label"
357
- )
358
-
359
- bw_image_btn = gr.Button("Convert", elem_classes="primary")
360
-
361
- with gr.Column(scale=1):
362
- bw_image_output = gr.Image(label="Processed Image")
363
-
364
- with gr.TabItem("Video Processing"):
365
- with gr.Row(equal_height=True):
366
- with gr.Column(scale=1):
367
- bw_video_input = gr.Video(label="Input Video")
368
-
369
- with gr.Group():
370
- bw_video_method = gr.Radio(
371
- choices=["otsu", "adaptive", "manual"],
372
- value="otsu",
373
- label="Thresholding Method",
374
- info=otsu_tooltip,
375
- elem_classes="radio-group"
376
- )
377
-
378
- bw_video_threshold = gr.Slider(
379
- minimum=0,
380
- maximum=255,
381
- value=127,
382
- step=1,
383
- label="Manual Threshold Value",
384
- info=manual_tooltip,
385
- interactive=True,
386
- elem_classes="slider-label"
387
- )
388
-
389
- bw_video_btn = gr.Button("Convert", elem_classes="primary")
390
-
391
- with gr.Column(scale=1):
392
- bw_video_output = gr.Video(label="Processed Video")
393
-
394
  with gr.TabItem("Pencil Sketch Converter", elem_classes="app-card"):
395
  with gr.Tabs() as sketch_tabs:
396
  with gr.TabItem("Image Processing"):
@@ -475,6 +414,73 @@ def create_interface():
475
  with gr.Column(scale=1):
476
  sketch_video_output = gr.Video(label="Processed Video")
477
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
478
  with gr.Row(elem_classes="container"):
479
  gr.Markdown("""
480
  ### How to use:
 
328
  Transform your media with professional black & white conversion and pencil sketch effects
329
  """)
330
 
331
+ with gr.Tabs() as tabs:
332
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
333
  with gr.TabItem("Pencil Sketch Converter", elem_classes="app-card"):
334
  with gr.Tabs() as sketch_tabs:
335
  with gr.TabItem("Image Processing"):
 
414
  with gr.Column(scale=1):
415
  sketch_video_output = gr.Video(label="Processed Video")
416
 
417
+
418
+
419
+ with gr.TabItem("Black & White Converter", elem_classes="app-card"):
420
+ with gr.Tabs() as bw_tabs:
421
+ with gr.TabItem("Image Processing"):
422
+ with gr.Row(equal_height=True):
423
+ with gr.Column(scale=1):
424
+ bw_image_input = gr.Image(label="Input Image", elem_classes="input-image")
425
+
426
+ with gr.Group():
427
+ bw_method = gr.Radio(
428
+ choices=["otsu", "adaptive", "manual"],
429
+ value="otsu",
430
+ label="Thresholding Method",
431
+ info=otsu_tooltip,
432
+ elem_classes="radio-group"
433
+ )
434
+
435
+ bw_threshold = gr.Slider(
436
+ minimum=0,
437
+ maximum=255,
438
+ value=127,
439
+ step=1,
440
+ label="Manual Threshold Value",
441
+ info=manual_tooltip,
442
+ interactive=True,
443
+ elem_classes="slider-label"
444
+ )
445
+
446
+ bw_image_btn = gr.Button("Convert", elem_classes="primary")
447
+
448
+ with gr.Column(scale=1):
449
+ bw_image_output = gr.Image(label="Processed Image")
450
+
451
+ with gr.TabItem("Video Processing"):
452
+ with gr.Row(equal_height=True):
453
+ with gr.Column(scale=1):
454
+ bw_video_input = gr.Video(label="Input Video")
455
+
456
+ with gr.Group():
457
+ bw_video_method = gr.Radio(
458
+ choices=["otsu", "adaptive", "manual"],
459
+ value="otsu",
460
+ label="Thresholding Method",
461
+ info=otsu_tooltip,
462
+ elem_classes="radio-group"
463
+ )
464
+
465
+ bw_video_threshold = gr.Slider(
466
+ minimum=0,
467
+ maximum=255,
468
+ value=127,
469
+ step=1,
470
+ label="Manual Threshold Value",
471
+ info=manual_tooltip,
472
+ interactive=True,
473
+ elem_classes="slider-label"
474
+ )
475
+
476
+ bw_video_btn = gr.Button("Convert", elem_classes="primary")
477
+
478
+ with gr.Column(scale=1):
479
+ bw_video_output = gr.Video(label="Processed Video")
480
+
481
+
482
+
483
+
484
  with gr.Row(elem_classes="container"):
485
  gr.Markdown("""
486
  ### How to use: