jijivski commited on
Commit
bccb671
1 Parent(s): bfe1f92

add former

Browse files
.gitignore CHANGED
@@ -1 +1,2 @@
1
  get_loss/__pycache__/
 
 
1
  get_loss/__pycache__/
2
+ *.pyc
__pycache__/app.cpython-37.pyc DELETED
Binary file (422 Bytes)
 
__pycache__/hello_test.cpython-310.pyc DELETED
Binary file (431 Bytes)
 
app.py CHANGED
@@ -21,7 +21,7 @@ def color_text(text_list=["hi", "FreshEval","!"], loss_list=[0.1,0.7]):
21
  loss_list=[0]+loss_list
22
  # print('loss_list',loss_list)
23
  # print('text_list',text_list)
24
- pdb.set_trace()
25
  for text, loss in zip(text_list, loss_list):
26
  # color = "#FF0000" if float(loss) > 0.5 else "#00FF00"
27
  color=loss/20#TODO rescale
 
21
  loss_list=[0]+loss_list
22
  # print('loss_list',loss_list)
23
  # print('text_list',text_list)
24
+ # pdb.set_trace()
25
  for text, loss in zip(text_list, loss_list):
26
  # color = "#FF0000" if float(loss) > 0.5 else "#00FF00"
27
  color=loss/20#TODO rescale
get_loss/__pycache__/get_loss_hf.cpython-310.pyc CHANGED
Binary files a/get_loss/__pycache__/get_loss_hf.cpython-310.pyc and b/get_loss/__pycache__/get_loss_hf.cpython-310.pyc differ
 
hf_space_test.py CHANGED
@@ -11,7 +11,10 @@ def predict(input_img):
11
 
12
  gradio_app = gr.Interface(
13
  predict,
14
- inputs=gr.Image(label="Select hot dog candidate", sources=['upload', 'webcam'], type="pil"),
 
 
 
15
  outputs=[gr.Image(label="Processed Image"), gr.Label(label="Result", num_top_classes=2)],
16
  title="Hot Dog? Or Not?",
17
  )
 
11
 
12
  gradio_app = gr.Interface(
13
  predict,
14
+ inputs=gr.Image(label="Select hot dog candidate", sources=['upload', 'webcam'], type="pil"),# upload means upload the image, webcam means use the camera,
15
+ # if I want to craw and drop the image, I can use the following code
16
+ # inputs=gr.Image(label="Select hot dog candidate", source='webcam', type="pil"),
17
+
18
  outputs=[gr.Image(label="Processed Image"), gr.Label(label="Result", num_top_classes=2)],
19
  title="Hot Dog? Or Not?",
20
  )
requirements.txt CHANGED
@@ -1,2 +1,3 @@
1
  transformers
2
  torch
 
 
1
  transformers
2
  torch
3
+ spacy